/* Dexqon's stylesheet: its only one (D.1 spec §6.1).
 *
 * The Sabzi look of the D.1 element sheet: a forest-green page, cream text and one
 * carrot-coloured action. Green means done, amber means hurry, red means error; no
 * other colour carries a meaning, and never alone -- a status is a dot and a word.
 * Every ink reads at 4.5:1 or better on every surface it is drawn on -- the page, a
 * group, a sheet, a group on a sheet, resting, hovered or pressed -- and so does every
 * other text and fill pair (tests/test_contrast.py parses :root and .sheet to check).
 * A sheet's surfaces are lighter, so on a sheet the link and error inks are a lighter
 * tint of the same carrot and red.
 *
 * Type: Plus Jakarta Sans for headings, Inter for everything else. Figures, codes and
 * costs are Inter with tabular digits; there is no monospace anywhere. Plus Jakarta Sans
 * is named by an allow-list of heading rules only (h1-h3, .brand), a test holds it there.
 * Both faces are served from /static/fonts (OFL, licences beside them): inside Telegram's
 * webview a font CDN is a round trip before the first paint. Plus Jakarta Sans has no
 * Cyrillic subset, only cyrillic-ext: a Cyrillic heading falls to Inter.
 *
 * Icons are the Material Symbols sprite (templates/_symbols.html), drawn as
 * <svg class="ms"> in the text's colour. The building blocks -- group, row, pill
 * button, status, steps, segment, sheet, toast, hold button, keypad, code boxes,
 * chart, badge, bar -- are the macros of templates/_d1.html; this file draws them.
 *
 * A few blocks are still plain markup, not _d1.html macros: the add-line, receiver and
 * photo forms of the shipment page, the pack page's labels, and the public page a label's QR
 * opens. Their rules (.meta, .field, .row, .line, the ghost button and their kin) are
 * grouped under "The plain blocks", in Sabzi colours. Dexqon holds no panel.css and no
 * palette it shares: Bazaar, Teaplaces and Yetkazuvchi keep theirs.
 */

/* ── Fonts ──────────────────────────────────────────────────────────────────
 *
 * Inter 400-700 cut from the official release (github.com/rsms/inter, v4.1) to the
 * three unicode ranges below, keeping tnum; byte for byte the files the other
 * services serve. Plus Jakarta Sans 600-800 for headings (fontsource 5.3.0).
 */

@font-face { font-family: "Inter"; font-style: normal;
  font-weight: 400; font-display: swap;
  src: url("../fonts/inter-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face { font-family: "Inter"; font-style: normal;
  font-weight: 400; font-display: swap;
  src: url("../fonts/inter-latin-ext-400-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face { font-family: "Inter"; font-style: normal;
  font-weight: 400; font-display: swap;
  src: url("../fonts/inter-latin-400-normal.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: "Inter"; font-style: normal;
  font-weight: 500; font-display: swap;
  src: url("../fonts/inter-cyrillic-500-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face { font-family: "Inter"; font-style: normal;
  font-weight: 500; font-display: swap;
  src: url("../fonts/inter-latin-ext-500-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face { font-family: "Inter"; font-style: normal;
  font-weight: 500; font-display: swap;
  src: url("../fonts/inter-latin-500-normal.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: "Inter"; font-style: normal;
  font-weight: 600; font-display: swap;
  src: url("../fonts/inter-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face { font-family: "Inter"; font-style: normal;
  font-weight: 600; font-display: swap;
  src: url("../fonts/inter-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face { font-family: "Inter"; font-style: normal;
  font-weight: 600; font-display: swap;
  src: url("../fonts/inter-latin-600-normal.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: "Inter"; font-style: normal;
  font-weight: 700; font-display: swap;
  src: url("../fonts/inter-cyrillic-700-normal.woff2") format("woff2");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face { font-family: "Inter"; font-style: normal;
  font-weight: 700; font-display: swap;
  src: url("../fonts/inter-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face { font-family: "Inter"; font-style: normal;
  font-weight: 700; font-display: swap;
  src: url("../fonts/inter-latin-700-normal.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: "Plus Jakarta Sans"; font-style: normal;
  font-weight: 600; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-cyrillic-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal;
  font-weight: 600; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext-600-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal;
  font-weight: 600; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-600-normal.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: "Plus Jakarta Sans"; font-style: normal;
  font-weight: 700; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-cyrillic-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal;
  font-weight: 700; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext-700-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal;
  font-weight: 700; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-700-normal.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: "Plus Jakarta Sans"; font-style: normal;
  font-weight: 800; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-cyrillic-ext-800-normal.woff2") format("woff2");
  unicode-range: U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F;
}
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal;
  font-weight: 800; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-ext-800-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF;
}
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal;
  font-weight: 800; font-display: swap;
  src: url("../fonts/plus-jakarta-sans-latin-800-normal.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;
}

/* ── The Sabzi palette ──────────────────────────────────────────────────────
 *
 * The element sheet's Dexqon set, token for token. Surfaces step up from the page:
 * --s1 a group, --s2 a sheet, --s3 a raised row or a quiet button (and the segment's
 * chosen option, --segon), --s4 pressed. --cta is the one action colour and --onac
 * the ink on it; --ac is the same carrot as an accent (the current tab, a step done).
 * --ok, --warn and --no are the three status inks; --nk, --nw and --nn their soft
 * fills, --dgbg and --dgfill a danger button's fill and its hold progress.
 */

:root {
  --bg: #07271D;
  --s1: #0E3427;
  --s2: #124031;
  --s3: #1B4D3C;
  --s4: #265B48;
  --tx: #F7F4EE;
  --mu: #A9C0B4;
  --dis: #6C8A7C;
  --ac: #FF7A00;
  --cta: #FF7A00;
  --on: #1C0D00;
  --onac: #1C0D00;
  --ok: #7EE2A0;
  --warn: #FFD166;
  --no: #FF8F85;
  --nk: rgba(98, 219, 150, .12);
  --nw: rgba(255, 190, 90, .12);
  --nn: rgba(255, 122, 122, .13);
  --dgbg: rgba(255, 122, 122, .14);
  --dgfill: rgba(255, 122, 122, .28);
  /* A hold button's progress under its red words: the sheet's --dgfill reads 3.7:1
     there, this 4.6:1 (tests/test_contrast.py). */
  --dghold: rgba(255, 122, 122, .16);
  /* A row or card under the finger: a shade, so every ink on it reads better, not worse
     (the design's --s4 under a muted line read 4.1:1). */
  --press: rgba(0, 0, 0, .14);
  --hair: rgba(255, 255, 255, .08);
  --raise: 0 0 0 1px rgba(255, 255, 255, .06), 0 1px 2px rgba(0, 0, 0, .4);
  --ring: rgba(255, 255, 255, .18);
  --knob: #FFFFFF;
  --glass: rgba(7, 39, 29, .88);
  --scrim: rgba(1, 12, 8, .64);
  --sheetsh: 0 -1px 0 rgba(255, 255, 255, .08), 0 -12px 40px rgba(0, 0, 0, .5);
  --hdl: rgba(255, 255, 255, .26);
  --invbg: #F7F4EE;
  --invtx: #07271D;
  --tint: rgba(255, 122, 0, .34);
  --wash: rgba(255, 255, 255, .06);
  --hover: rgba(255, 255, 255, .03);
  --oktoast: #0B8A3C;
  --segon: #1B4D3C;
  --ease: cubic-bezier(.23, 1, .32, 1);
}

/* ── Base ───────────────────────────────────────────────────────────────── */

* { box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--tx);
  font: 16px/1.5 "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 {
  font-family: "Plus Jakarta Sans", "Inter", sans-serif; color: var(--tx);
  margin: 0 0 .5rem; letter-spacing: -.01em;
}
h1 { font-size: 28px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
h2 { font-size: 20px; font-weight: 700; line-height: 1.25; }
h3 { font-size: 16px; font-weight: 700; line-height: 1.35; }
p { margin: 0 0 .75rem; }
a { color: var(--ac); text-decoration: none; }
/* No 300ms double-tap wait, and no grey flash, on anything that is tapped. */
a, button, input, select, textarea, label, summary {
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
summary { cursor: pointer; }
:focus-visible { outline: 2px solid var(--ac); outline-offset: 2px; }
/* A section the page has not shown yet is hidden by the attribute alone, whatever
   display a class gives it (the pack page's weighing, the keypad's keys). */
[hidden] { display: none !important; }

/* Read by a screen reader, not drawn. */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Names are cut at two or three lines (a farm's, a buyer's, a product's), never let
   to push a row's figures off the screen; one line where there is room for one. */
.clamp-1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2, .clamp-3 {
  display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.clamp-2 { -webkit-line-clamp: 2; line-clamp: 2; }
.clamp-3 { -webkit-line-clamp: 3; line-clamp: 3; }

/* A Material Symbols glyph (_symbols.html), in the colour of the text around it. Its
   size is the macro's width and height. */
.ms { fill: currentColor; flex: none; display: inline-block; vertical-align: middle; }

/* ── The app's frame ────────────────────────────────────────────────────── */

/* The name on top, in a browser only: inside Telegram its own header says it. */
.topbar {
  position: sticky; top: 0; z-index: 100; display: flex; align-items: center;
  padding: 14px 16px; background: var(--glass);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: inset 0 -1px 0 var(--hair);
}
.brand { font: 800 20px/1.2 "Plus Jakarta Sans", "Inter", sans-serif; color: var(--tx); }
body.in-telegram .topbar { display: none; }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 32px; }
/* Room under the last row for the tab bar, which floats over the page. */
.tabbar ~ main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

/* The owner's four tabs, where a thumb reaches (Telegram's habit). Glass over the
   page; the current tab in the accent, the others muted; a count where orders wait. */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 8px 8px calc(12px + env(safe-area-inset-bottom, 0px));
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%);
  box-shadow: inset 0 1px 0 var(--hair);
}
.tabbar a {
  position: relative; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; min-height: 48px;
  font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--mu);
}
.tabbar a.on { color: var(--ac); }
.tabbar .badge { position: absolute; top: 0; left: calc(50% + 6px); }

/* What is waiting, on a tab or a row: the error red, the page's colour on it. */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--no); color: var(--bg); font: 700 11px/1 "Inter", sans-serif;
  font-variant-numeric: tabular-nums;
}

/* The page loading after a tap: scaled, not resized, so it runs on the compositor. */
.top-loader {
  position: fixed; top: 0; left: 0; height: 3px; width: 100%; z-index: 10000;
  background: var(--ac); transform-origin: left; transform: scaleX(0); opacity: 0;
  transition: transform .3s var(--ease), opacity .2s ease; pointer-events: none;
}
.top-loader.loading { opacity: 1; transform: scaleX(.7); animation: loader-pulse 1.8s infinite ease-in-out; }
@keyframes loader-pulse {
  0% { transform: scaleX(.25); }
  50% { transform: scaleX(.75); }
  100% { transform: scaleX(.9); }
}

/* ── Groups and rows ────────────────────────────────────────────────────── */

/* A section's name above its group, with a note on the right ("so'nggi 7 kun"). */
.sec {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  margin: 22px 4px 8px; font: 600 13px/1.3 "Inter", sans-serif;
  font-variant-numeric: tabular-nums; letter-spacing: 0;
  color: var(--mu);
}
.sec span + span { font-weight: 500; }
.grp-wrap { margin: 0 0 12px; }

/* Rows grouped on one surface with a soft shadow, not boxes with borders. */
.grp { background: var(--s1); border-radius: 14px; box-shadow: var(--raise); overflow: hidden; }

/* A row: what it is on the left, its value on the right. */
.cell {
  position: relative; display: flex; align-items: center; gap: 12px;
  min-height: 58px; padding: 11px 14px; color: inherit;
}
.cell + .cell::before, .cell-acts + .cell::before, .cell-prog + .cell::before,
.diff + .cell::before, .grp-pad + .cell::before {
  content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--hair);
}
a.cell:active { background: var(--press); }
@media (hover: hover) and (pointer: fine) { a.cell:hover { background: var(--hover); } }
.cell-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.cell-label { font-size: 15px; font-weight: 600; line-height: 1.3; }
.cell-hint {
  font-size: 13px; line-height: 1.35; color: var(--mu); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.cell-value {
  margin-left: auto; flex: 0 0 auto; max-width: 60%; text-align: right;
  font-size: 15px; font-weight: 600; overflow-wrap: anywhere;
}
/* A status standing as a row's value (Qaytarish kerak: 32 000 so'm, the QR page's "Qabul qilindi
   · tasdiqlanmagan") takes a second line at the width it has, as the status under a figure
   does, instead of being cut at the row's edge. */
.cell-value .dot { white-space: normal; }
.cell-value > .dot { text-align: left; align-items: flex-start; }
.cell-value > .dot i { margin-top: .4em; }
.cell > .ms { color: var(--mu); }
/* A row led by an icon on a raised square: the screens' promises and links. */
.cell-ico {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 10px; background: var(--s3);
  color: var(--ac); display: flex; align-items: center; justify-content: center;
}
/* A person's initial on a disc leads a row (the buyer's, on Buyurtmalar). */
.cell-av {
  flex: 0 0 36px; width: 36px; height: 36px; border-radius: 50%; background: var(--s3);
  color: var(--tx); display: flex; align-items: center; justify-content: center;
  font: 700 14px/1 "Inter", sans-serif;
}
/* A row led by a Fluent picture on a raised square: the guide's steps. */
.cell-art {
  flex: 0 0 48px; width: 48px; height: 48px; border-radius: 12px; background: var(--s3);
  display: flex; align-items: center; justify-content: center;
}
/* The green tick of a row that is done (a step of the guide already read). */
.cell-done { display: flex; color: var(--ok); }
/* A value that is words -- an address, the buyer's note -- wraps to the width it has instead
   of being cut at the edge of its row. */
.cell-value .wrap { display: block; white-space: normal; overflow-wrap: anywhere; font-weight: 500; }
/* The call button on the buyer's row: a disc, the phone's own dialler behind it. */
.cell-call {
  display: flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 50%; background: var(--s3); color: var(--tx);
}
.cell-call:active { background: linear-gradient(var(--press), var(--press)), var(--s3); }
/* A row's figure with the status under it, both at the right edge (Bugun): the amount, and
   the dot that says what is up with it. The status may take two lines where its words are long
   ("Qabul tekshiruvi kutilmoqda"); the figure never does. */
.cell-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.cell-stack .dot { white-space: normal; text-align: right; }
/* What can be done with a row, under it and inside its group: two pills side by side, sharing
   the width (Rad etish, Qabul qilish). */
.cell-acts { display: flex; gap: 8px; padding: 0 14px 14px; }
.cell-acts > .pill, .cell-acts > form { flex: 1 1 0; min-width: 0; }
.cell-acts > form { margin: 0; }
.cell-acts > form > .pill { width: 100%; }
/* How far a row has come, under it: the bar and its words on the left, the pill that goes on
   on the right. */
.cell-prog { display: flex; align-items: center; gap: 12px; padding: 0 14px 14px; }
.cell-prog-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.cell-prog-words { font-size: 13px; line-height: 1.35; color: var(--mu); }
.cell-prog > .pill { flex: none; }
/* A section's count next to its name. */
.sec b { margin-left: 4px; font-weight: 700; color: var(--tx); }
/* A row that is the label of the field on its right: the words stay as long as they are,
   the field takes the rest and writes toward the right edge, as a value does. The row shows
   the focus, so the field itself carries none. */
.cell-field { cursor: text; }
.cell-field:focus-within { outline: 2px solid var(--ac); outline-offset: -2px; }
.cell-field .cell-body { flex: 0 0 auto; max-width: 42%; }
.cell-field .cell-value {
  flex: 1 1 0; min-width: 0; max-width: none; overflow: visible;
  display: flex; align-items: center; justify-content: flex-end; gap: 6px;
}
.cell-field :where(input, select) {
  flex: 1; min-width: 0; width: 100%; min-height: 0; padding: 0; background: none;
  box-shadow: none; text-align: right; font-weight: 500; text-overflow: ellipsis;
}
.cell-field select { -webkit-appearance: none; appearance: none; text-align-last: right; cursor: pointer; }
.cell-field select:invalid { color: var(--mu); }
.cell-field .cell-value > .ms { color: var(--mu); }
/* A segment on a row is the compact one: the choice in cream on the quiet fill. */
.cell-value .seg {
  display: inline-grid; grid-template-columns: repeat(var(--n, 2), auto);
  padding: 2px; border-radius: 9px; background: var(--s3); box-shadow: none;
}
.cell-value .seg-opt span { height: 32px; padding: 0 10px; border-radius: 7px; }
/* A row whose value is a segment of three words (Yetkazish: O'zim, Xaridor, Ikkalasi): the
   segment is as wide as its words need, and drops under the row's name where the two do not
   fit side by side on one line, as at 320px. */
.cell-seg { flex-wrap: wrap; }
.cell-seg > .cell-body { flex: 1 1 auto; }
.cell-seg > .cell-value {
  flex: 1 1 auto; max-width: 100%; display: flex; justify-content: flex-end;
}
.cell-value .seg-opt input:checked + span { background: var(--tx); color: var(--bg); box-shadow: none; }

/* A phone 320px wide has about 260px inside a row: the leading disc, the figure and the
   chevron leave the words a few letters, and a name is cut to "Anor 100 ...". The disc is a
   little smaller, the chevron goes (the whole row is still the link) and the gaps tighten, so
   the words keep their two lines. */
@media (max-width: 359px) {
  .cell { gap: 10px; padding: 11px 12px; }
  .cell-ico, .cell-av { flex-basis: 30px; width: 30px; height: 30px; }
  .cell-ico .ms { width: 18px; height: 18px; }
  a.cell > .ms:last-child { display: none; }
  .cell-value, .cell-stack .dot { font-size: 14px; }
  .cell-acts, .cell-prog { padding: 0 12px 12px; }
}

/* ── Buttons ────────────────────────────────────────────────────────────── */

/* Pills: 52px the main action, 44px medium, 36px small. A press scales to 0.97 over
   160ms, as the design's do. */
.pill {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; min-width: 0; padding: 0 20px; border: 0; border-radius: 999px;
  font: 600 16px/1.2 "Inter", sans-serif;
  font-variant-numeric: tabular-nums; text-align: center; text-decoration: none;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.pill:active { transform: scale(.97); }
.pill-main { background: var(--cta); color: var(--onac); }
.pill-quiet { background: var(--s3); color: var(--tx); }
/* The danger fill is translucent: drawn over the page's colour on any surface, so its
   red words read the same on a sheet as on the page. */
.pill-danger { background: linear-gradient(var(--dgbg), var(--dgbg)), var(--bg); color: var(--no); }
.pill-md { height: 44px; font-size: 15px; }
.pill-sm { height: 36px; padding: 0 14px; font-size: 14px; }
/* Sent, waiting for the server (base.html disables it), or not yet possible. */
.pill:disabled { background: var(--s3); color: var(--dis); cursor: default; transform: none; }
/* Main actions stacked, each the full width. */
.pills { display: flex; flex-direction: column; gap: 8px; margin: 16px 0; }
.pills > .pill, .pills > form > .pill { width: 100%; }

/* Press and hold (hold.js): the fill grows with --p from 0 to 1 while held, in
   --dghold so the words over it still read at 4.5:1. Without the script it is a plain
   button. */
.hold-form { margin: 0; }
.hold {
  position: relative; overflow: hidden; width: 100%;
  /* A long press must not select the words or open the phone's menu over the button. */
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}
.hold::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0;
  width: calc(var(--p, 0) * 100%); background: var(--dghold);
}
.hold > span { position: relative; display: inline-flex; align-items: center; gap: 8px; }
/* "Bosib turing" under the button for a moment after a press let go too soon (hold.js);
   a polite live region, so it is empty, and takes no room, the rest of the time. */
.hold-hint { display: block; text-align: center; font-size: 13px; font-weight: 500; line-height: 1.3; color: var(--mu); }
.hold-hint:not(:empty) { margin-top: 8px; }

/* ── Status and progress ────────────────────────────────────────────────── */

/* A status is a dot and a word: "to'landi", "5 soat qoldi", "kod kutilmoqda". */
.dot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; line-height: 1.3; white-space: nowrap;
}
.dot i { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 8px; background: currentColor; }
.dot-ok { color: var(--ok); }
.dot-warn { color: var(--warn); }
.dot-no { color: var(--no); }
.dot-muted { color: var(--mu); }

/* Qadoq · Kod · Jo'natish · Yo'lda · Qabul: done steps filled and ticked, the one
   under way ringed, the rest outlined; the line between two steps lights up once the
   second is reached. */
.steps { display: flex; margin: 6px 0 0; padding: 0; list-style: none; }
.steps li {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column;
  align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--mu);
}
.steps li + li::before {
  content: ""; position: absolute; top: 10px; left: calc(-50% + 15px); right: calc(50% + 15px);
  height: 2px; border-radius: 1px; background: var(--s3);
}
.steps li.done::before, .steps li.now::before { background: var(--ac); }
.steps .done, .steps .now { color: var(--tx); }
.steps-mark {
  width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; box-shadow: inset 0 0 0 2px var(--s3);
}
.steps .done .steps-mark { background: var(--ac); color: var(--onac); box-shadow: none; }
.steps .now .steps-mark { box-shadow: inset 0 0 0 6px var(--ac); }
.steps-word { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A stacked bar: what open orders hold, then what is still on sale. */
.meter { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--s3); }
.meter i { display: block; height: 100%; }
.meter-held { background: var(--tint); }
.meter-sale { background: var(--ac); }

/* The seven days' orders (drawn on the server): today in the accent. */
.chart { display: block; width: 100%; height: auto; }
.chart rect { fill: var(--s3); }
.chart rect.today { fill: var(--ac); }
.chart text {
  font: 600 11px "Inter", sans-serif; font-variant-numeric: tabular-nums;
  fill: var(--mu); text-anchor: middle;
}
.chart text.today { fill: var(--tx); }
.chart .chart-day { font-weight: 500; }

/* What must be read before going on, on a soft fill of its status colour. The words stay
   in the text colour (they read at 4.5:1 on every fill, tests/test_contrast.py); the glyph
   carries the colour. */
.note {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding: 12px 14px;
  border-radius: 12px; font-size: 14px; line-height: 1.4;
}
.note > .ms { margin-top: 1px; }
.note-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.note-no { background: var(--nn); }
.note-no > .ms { color: var(--no); }
.note-ok { background: var(--nk); }
.note-ok > .ms { color: var(--ok); }
.note-warn { background: var(--nw); }
.note-warn > .ms { color: var(--warn); }

/* A timeline, one step under another: a ticked disc when done, a ring where it is now,
   an outline for what is to come; the line down to the next step is lit once this one is
   done. */
.tl { margin: 18px 12px 0; padding: 0; list-style: none; }
.tl li {
  position: relative; display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: 12px;
  padding-bottom: 18px;
}
.tl li:last-child { padding-bottom: 0; }
.tl li:not(:last-child)::before {
  content: ""; position: absolute; left: 11px; top: 30px; bottom: 4px; width: 2px;
  border-radius: 1px; background: var(--s3);
}
.tl li.done:not(:last-child)::before { background: var(--ac); }
.tl-mark {
  width: 24px; height: 24px; margin-top: 2px; border-radius: 50%; display: flex;
  align-items: center; justify-content: center; box-shadow: inset 0 0 0 2px var(--s3);
}
.tl .done .tl-mark { background: var(--ac); color: var(--onac); box-shadow: none; }
.tl .now .tl-mark { box-shadow: inset 0 0 0 7px var(--ac); }
.tl-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tl-title { font-size: 15px; font-weight: 600; line-height: 1.3; color: var(--tx); overflow-wrap: anywhere; }
.tl .next .tl-title { color: var(--mu); }
.tl-note { font-size: 13px; line-height: 1.35; color: var(--mu); overflow-wrap: anywhere; }

/* ── Choosing ───────────────────────────────────────────────────────────── */

/* A segment: radio buttons drawn as one control, the chosen one raised. The radio
   itself stays (invisible, over its option) so a tap, the keyboard and a screen
   reader all work as they do on a radio. */
.seg {
  display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 2px;
  padding: 3px; background: var(--s1); border-radius: 11px; box-shadow: var(--raise);
}
.seg-opt { position: relative; display: block; }
.seg-opt input {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer;
}
.seg-opt span {
  height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: 0 8px; font-size: 14px; font-weight: 600; color: var(--mu);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.seg-opt input:checked + span { background: var(--segon); color: var(--tx); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--ac); outline-offset: 1px; }
/* How many are in a segment's option, after its name (Faol 3, Yopilgan 4). */
.seg-opt em { font-style: normal; font-size: 12px; font-weight: 600; color: var(--mu); }

/* Chips: checkboxes drawn as pills, the chosen ones in cream with a tick. The box lies over
   its chip unseen, so a tap, the keyboard and a screen reader all work as on a checkbox.
   "N ta tanlandi" is a CSS counter: every ticked box counts one, and the figure is drawn
   from the count after the chips (_d1.html puts it there so the counter has seen them all)
   into the header's right-hand cell, with no script. */
.chips-box {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: baseline;
  counter-reset: picked;
}
.chips-title { grid-area: 1 / 1; }
.chips-count {
  grid-area: 1 / 2; margin: 22px 4px 8px 0; font: 500 13px/1.3 "Inter", sans-serif;
  font-variant-numeric: tabular-nums; color: var(--mu);
}
.chips-count b { font-weight: 500; }
.chips-count b::before { content: counter(picked); }
.chips { grid-area: 2 / 1 / 3 / 3; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 4px; }
.chip { position: relative; display: block; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip input:checked { counter-increment: picked; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px;
  border-radius: 20px; background: var(--s1); box-shadow: var(--raise); color: var(--mu);
  font-size: 14px; font-weight: 600; white-space: nowrap;
}
.chip-on, .chip-add { display: none; line-height: 0; }
.chip input:checked + span { background: var(--tx); color: var(--bg); box-shadow: none; }
.chip input:checked + span .chip-on { display: inline-flex; }
.chip-other span { color: var(--ac); }
.chip-other input:not(:checked) + span .chip-add { display: inline-flex; }
.chip input:focus-visible + span { outline: 2px solid var(--ac); outline-offset: 2px; }
/* On a sheet the unchosen chips are the sheet's raised fill, as its groups are: the page's
   (--s1) is darker than the sheet and would sink into it. */
.sheet .chip span { background: var(--s3); }

/* ── Fields ─────────────────────────────────────────────────────────────── */

/* 16px, never less: iOS zooms the whole Mini App into a smaller field. */
:where(input:not([type="radio"], [type="checkbox"], [type="hidden"], [type="file"]), select, textarea) {
  font: 16px/1.4 "Inter", sans-serif; font-variant-numeric: tabular-nums; color: var(--tx);
  min-height: 44px; padding: 10px 14px; border: 0; border-radius: 12px;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--ring); outline: none;
}
:where(input, select, textarea):focus-visible { box-shadow: inset 0 0 0 2px var(--ac); }
:where(input[type="file"]) { font: 16px "Inter", sans-serif; color: var(--mu); max-width: 100%; }
:where(input[type="radio"], input[type="checkbox"]) { accent-color: var(--ac); }
::placeholder { color: var(--mu); opacity: 1; }

/* The weight keypad (keypad.js). Without the script the figure is a plain field the
   phone's own keyboard types into, and the keys stay hidden. */
.keypad { display: flex; flex-direction: column; gap: 16px; }
.keypad-figure { display: flex; align-items: baseline; justify-content: center; gap: 8px; margin: 0; }
.keypad-input {
  width: 7ch; min-width: 0; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none;
  text-align: right; font: 700 44px/1.1 "Inter", sans-serif; font-variant-numeric: tabular-nums;
  letter-spacing: -.01em; color: var(--tx);
}
.keypad-unit { font-size: 20px; font-weight: 600; color: var(--mu); }
.keypad-note { margin: 0; text-align: center; font-size: 14px; line-height: 1.4; color: var(--no); }
.keys { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.key {
  height: 58px; border: 0; border-radius: 999px; background: var(--s1); box-shadow: var(--raise);
  color: var(--tx); font: 600 24px/1 "Inter", sans-serif;
  font-variant-numeric: tabular-nums; display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: transform 160ms var(--ease);
}
.key:active { transform: scale(.97); background: linear-gradient(var(--press), var(--press)), var(--s1); }

/* The receipt code in three boxes (code.js makes a typed one three boxes too).
   Inter, like every figure: its alphabet has no look-alikes to tell apart. */
.code-boxes { display: flex; gap: 10px; justify-content: center; margin: 0; }
.code-boxes span {
  width: 60px; height: 68px; border-radius: 14px; background: var(--s1); box-shadow: var(--raise);
  display: flex; align-items: center; justify-content: center;
  font: 700 30px/1 "Inter", sans-serif; font-variant-numeric: tabular-nums; color: var(--tx);
}
.code-boxes span.act { box-shadow: 0 0 0 2px var(--ac); }
/* With the script (code.js adds .on) the three boxes are what is seen, and the field -- the
   one the form posts, and the one the keyboard types into -- lies over them unseen. */
.code-boxes.on { position: relative; }
.code-boxes.on .code-field {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; min-height: 0;
  padding: 0; opacity: 0;
}
.code-field {
  width: 8ch; min-height: 68px; padding: 0 12px; border-radius: 14px; border: 0;
  background: var(--s1); box-shadow: var(--raise); color: var(--tx); text-align: center;
  font: 700 30px/1 "Inter", sans-serif;
  font-variant-numeric: tabular-nums; letter-spacing: .2em; text-transform: uppercase;
}

/* ── Sheets and toasts ──────────────────────────────────────────────────── */

/* A bottom sheet. sheet.js opens the <dialog> as a modal (its backdrop the scrim);
   without the script the sheet is the page's #target, the scrim its shadow. */
.sheet {
  position: fixed; top: auto; right: 0; bottom: 0; left: 0; z-index: 200;
  width: 100%; max-width: 640px; max-height: 90vh; margin: 0 auto; overflow: auto;
  flex-direction: column; gap: 12px; padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  border: 0; border-radius: 20px 20px 0 0; background: var(--s2); color: var(--tx);
  box-shadow: var(--sheetsh);
}
/* A sheet and the groups on it (--s3) are lighter than the page: the carrot of a link
   and the red of an error are a lighter tint there, still carrot and red, so they read
   at 4.5:1 on the sheet, its groups, and a row hovered in one (the design's own read
   3.7:1 on a sheet's group). */
.sheet {
  --ac: #FFA65A;
  --no: #FFA49B;
}
.sheet[open], .sheet:target { display: flex; }
.sheet:target { box-shadow: var(--sheetsh), 0 0 0 100vmax var(--scrim); }
/* A sheet drawn open by the server (a refused save) is not modal until a script makes it so:
   its scrim is its shadow, as the :target one's. */
.sheet[open]:not(:modal) { box-shadow: var(--sheetsh), 0 0 0 100vmax var(--scrim); }
.sheet::backdrop { background: var(--scrim); }
/* The grip and the title row are what a finger drags down to close it (sheet.js): the
   browser must not take that touch for a scroll. */
.sheet-grip, .sheet-head { touch-action: none; }
.sheet-grip { flex: none; width: 36px; height: 5px; border-radius: 3px; background: var(--hdl); margin: 0 auto 4px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-title { margin: 0; font-size: 20px; }
.sheet-close {
  flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--s3); color: var(--tx);
  display: flex; align-items: center; justify-content: center;
}
.sheet .grp, .sheet .seg { background: var(--s3); }
/* A sheet that asks something and is held to send: the question's parts one under another. */
.sheet .hold-form { display: flex; flex-direction: column; gap: 12px; }
.sheet .hold-form .hold-hint:not(:empty) { margin-top: 0; }
.sheet-close-link {
  display: flex; align-items: center; justify-content: center; min-height: 44px;
  font: 600 15px/1.2 "Inter", sans-serif; color: var(--tx);
}

/* What was just done, with Qaytarish where it can be undone (toast.js). The script owns
   its six seconds -- it waits while the toast is hovered or holds focus -- and adds
   .leaving for the fade; without the script the toast simply stays where it is. */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 300; max-width: 608px; margin: 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 14px; border-radius: 12px; background: var(--invbg); color: var(--invtx);
  font-size: 14px; font-weight: 500; line-height: 1.3; box-shadow: 0 8px 28px rgba(0, 0, 0, .5);
}
.toast.leaving { animation: toast-away .2s var(--ease) forwards; }
.tabbar ~ main .toast { bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
/* On a screen with a dock the toast stands above it, not over its button. */
.with-dock .toast { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
.toast > .ms { color: var(--oktoast); }
.toast-text { flex: 1; min-width: 0; }
.toast-undo {
  flex: none; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; cursor: pointer;
  background: var(--invtx); color: var(--invbg); font: 600 13px/1 "Inter", sans-serif;
}
@keyframes toast-away { to { opacity: 0; visibility: hidden; transform: translateY(8px); } }

/* ── Whole screens ──────────────────────────────────────────────────────── */

/* A screen that ends in a dock (the sign-in and the application): room under the last row
   for the dock, which floats over the page, as the tab bar does. */
.with-dock { padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px)); }
/* A field or a link the browser scrolls into view when it takes focus is kept clear of what
   floats over the foot of the page, the dock and the tab bar: without this the last field of
   a form was left under the dock ("Eng kam buyurtma", a crop chip, the driver's note), at
   390x500 and at 390x844 alike (WCAG 2.2, Focus Not Obscured). */
html { scroll-padding-bottom: calc(168px + env(safe-area-inset-bottom, 0px)); }

/* The scene on top, the name or the news under it, the words under that. */
.hero {
  display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 0 auto 8px;
  padding: 12px 12px 0; text-align: center;
}
.hero h1 { margin: 0; font-size: 32px; }
.hero-sm h1 { font-size: 26px; }
.hero .art { margin: 0; }
/* The Mini App's own entry, while it signs in: down the page a little, and the red glyph
   only if Telegram's answer was refused (the page's script shows it). */
.hero-wait { padding-top: 12vh; }
.hero-fail { display: none; color: var(--no); line-height: 0; }
.lead { margin: 0; max-width: 310px; font-size: 15px; line-height: 1.4; color: var(--mu); }
.sub { margin: 0; font-size: 14px; line-height: 1.4; color: var(--mu); }

/* A form's head: its name and what it is for on the left, a small picture on the right. */
.page-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 4px 4px 12px;
}
.page-head h1 { margin: 0 0 4px; }

/* What a thumb does last, where it reaches: the main action, and what goes with it, over
   the page in glass. */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px max(16px, calc(50% - 304px)) calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  box-shadow: inset 0 1px 0 var(--hair);
}
.dock .pill { width: 100%; }
.dock form { margin: 0; }
/* Telegram's Login Widget draws its own button in an iframe: in the middle of the dock. */
.dock iframe { align-self: center; }
.dock .fine { margin: 0; text-align: center; }
/* Two answers side by side, sharing the width (Rad etish, Qabul qilish). */
.dock-row { display: flex; gap: 8px; }
.dock-row > * { flex: 1 1 0; min-width: 0; }

/* A line of small print under a group or a button. */
.fine { margin: 8px 4px 0; font-size: 13px; line-height: 1.35; color: var(--mu); }

/* An order's page (X04) ---------------------------------------------------------------- */

/* The answer owed, and how long is left: its words large, the share of the time left under
   them (a bar drawn on the server), and what happens if nobody answers. */
.deadline { display: flex; flex-direction: column; gap: 8px; margin: 16px 4px 0; }
.deadline-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.deadline-label { font-size: 13px; font-weight: 600; color: var(--mu); }
.deadline .dot {
  font: 700 17px/1.2 "Inter", sans-serif; font-variant-numeric: tabular-nums; white-space: normal;
}
.deadline .fine { margin: 0; }

/* The two sides' figures, a line each: the farmer's, the buyer's, how far short. */
.diff { margin: 0; font-size: 14px; }
.diff th { padding: 10px 8px; border-bottom: 0; font-size: 12px; font-weight: 600; color: var(--mu); }
.diff td { padding: 10px 8px; border-bottom: 0; }
.diff tbody tr + tr td { box-shadow: inset 0 1px 0 var(--hair); }
.diff th:first-child, .diff td:first-child { padding-left: 14px; }
.diff th:last-child, .diff td:last-child { padding-right: 14px; }
.diff td:first-child { font-weight: 600; overflow-wrap: anywhere; }
.diff td.short { color: var(--warn); font-weight: 600; }

/* A named field on a sheet or a page: its name over it, muted. */
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span {
  font: 600 13px/1.3 "Inter", sans-serif;
  font-variant-numeric: tabular-nums; color: var(--mu);
}
.fld textarea { width: 100%; resize: none; }

/* A line of small print led by a glyph. */
.fine-icon { display: flex; align-items: flex-start; gap: 8px; margin: 0; }
.fine-icon > .ms { margin-top: 1px; }

/* ── Illustrations ──────────────────────────────────────────────────────── */

/* A Fluent scene or object; held square before it arrives, so the text never jumps. */
.art { flex: none; object-fit: contain; }
.art:not([width]) { display: block; width: 100%; max-width: 220px; height: auto; aspect-ratio: 1; margin: 0 auto 16px; }

/* ── Leaflet ────────────────────────────────────────────────────────────── */

/* The pin-picker (js/pin.js). z-index 0 makes the map its own stacking context:
   Leaflet numbers its panes and controls up to 1000, which would otherwise draw
   them over the top bar and the tab bar. */
.map {
  height: 300px; margin: .6rem 0; position: relative; z-index: 0;
  border-radius: 12px; overflow: hidden; box-shadow: var(--raise);
}
.pin-numbers { gap: .8rem; margin-bottom: 1rem; }
.pin-numbers input { width: 11rem; }

/* Leaflet sets its zoom buttons in a monospace face and the rest of the map in
   Helvetica. Dexqon has one face for text and figures alike: Inter. These win
   because base.html loads leaflet.css before this file. */
.leaflet-container,
.leaflet-container a.leaflet-popup-close-button,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
  font-family: "Inter", sans-serif;
}

/* Its zoom buttons and the attribution line in the page's own colours: Leaflet's white and
   its blue link are no colour of the Sabzi set. The map's tiles are the map's own. */
.leaflet-bar a, .leaflet-bar a:hover, .leaflet-bar a:focus {
  background-color: var(--s3); color: var(--tx); border-bottom-color: var(--hair);
}
.leaflet-bar a.leaflet-disabled { background-color: var(--s3); color: var(--dis); }
.leaflet-bar, .leaflet-touch .leaflet-bar { box-shadow: var(--raise); border: 0; }
.leaflet-container .leaflet-control-attribution { background: var(--glass); color: var(--mu); }
.leaflet-container .leaflet-control-attribution a { color: var(--tx); }

/* ── The plain blocks ─────────────────────────────────────────────────────────────── */

/* The markup of the forms, labels and public page that are not _d1.html macros, in the
   Sabzi colours. A rule here goes when the last template that names its class does. */

.row { display: flex; gap: .8rem 1.2rem; flex-wrap: wrap; align-items: center; }
.row.line { gap: .8rem; padding: .6rem 0; border-bottom: 1px solid var(--hair); }
.grow { flex: 1 1 auto; min-width: 0; }
.muted { color: var(--mu); }
.num { font-family: "Inter", sans-serif; font-variant-numeric: tabular-nums; }
.error { color: var(--no); font-weight: 500; }
.eyebrow {
  display: block; margin-bottom: .25rem; font: 500 14px "Inter", sans-serif;
  font-variant-numeric: tabular-nums; color: var(--mu);
}
.empty { color: var(--mu); padding: 2rem 1rem; text-align: center; }
.empty h2 { color: var(--tx); }

/* A supporting fact, not a status; a dot when it is good news. */
.meta { font-size: 14px; line-height: 1.5; color: var(--mu); }
.meta.ok::before {
  content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--ok); margin-right: 6px; vertical-align: 1px;
}

/* The buttons of the plain forms, as pills: unclassed is the main action. */
button:not([class]), button.ghost {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 0 18px; border: 0; border-radius: 999px; cursor: pointer;
  font: 600 15px/1.2 "Inter", sans-serif;
  font-variant-numeric: tabular-nums; background: var(--cta); color: var(--onac);
  transition: transform 160ms var(--ease);
}
button:not([class]):active, button.ghost:active { transform: scale(.97); }
button.ghost { background: var(--s3); color: var(--tx); }
button:not([class]):disabled, button.ghost:disabled {
  background: var(--s3); color: var(--dis); cursor: progress; transform: none;
}

/* A field with its name above it. */
.field { display: inline-flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 500; color: var(--tx); }
.field.wide { display: flex; width: 100%; }
.field.wide input, .field.wide select { width: 100%; }
form.inline { display: flex; gap: .8rem; flex-wrap: wrap; align-items: flex-end; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .8rem .5rem; border-bottom: 1px solid var(--hair); }
th { font-size: 12px; color: var(--mu); font-weight: 500; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* The receipt code, on the pack page and the public page. */
.code-list {
  font: 600 24px/1.2 "Inter", sans-serif; font-variant-numeric: tabular-nums;
  letter-spacing: .04em; color: var(--tx); margin: 0 0 .2rem;
}
/* "Brutto 25,42 → Netto 25,30 kg", and a tag's words written by hand. */
.reading, .hand {
  font: 600 24px/1.3 "Inter", sans-serif; font-variant-numeric: tabular-nums; color: var(--tx);
  margin: .2rem 0 .6rem;
}
.hand { font-size: 22px; margin: .3rem 0; }
#weigh form { margin: .6rem 0 0; }

.handling { margin: .6rem 0; padding-left: 1.2rem; }
.handling li { margin: .2rem 0; }

/* "Qo'lda kiritish": a form opened in place, with or without JS. */
details.typed { margin-top: .8rem; }
details.typed > summary {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; list-style: none;
  border-radius: 999px; font: 600 15px "Inter", sans-serif;
  font-variant-numeric: tabular-nums; color: var(--tx); background: var(--s3);
}
details.typed > summary::-webkit-details-marker { display: none; }
details.typed[open] > summary { margin-bottom: .8rem; }

.grades { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem; }
.grade.this .num { font-weight: 600; }
.grade-photo { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; }
div.grade-photo {
  display: flex; align-items: center; justify-content: center; text-align: center; padding: .6rem;
  border: 2px dashed var(--ring); font-size: 14px; color: var(--mu);
}

.line-photos { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; }
.line-photos .field { max-width: 100%; }
.line-photo { display: flex; flex-direction: column; gap: .3rem; }
.line-photos input[type="file"] { width: 100%; max-width: 22rem; }
.photo-thumb { width: 96px; height: 72px; object-fit: cover; border-radius: 12px; }
.packing-photo { margin: 0 0 1rem; }
.packing-photo img { display: block; max-width: 100%; border-radius: 12px; }
.packing-photo figcaption { margin-top: .3rem; }

/* A checklist line that stops the shipment, or warns; a label to write by hand. */
.cell.check-warn { box-shadow: inset 3px 0 0 var(--warn); }
.label-state { flex-basis: 100%; }
.label-write { box-shadow: inset 3px 0 0 var(--warn); padding: .2rem 0 .2rem .8rem; }
.label-write form { margin-top: .5rem; }

.party { margin-top: 1rem; padding-top: .6rem; border-top: 1px solid var(--hair); }
.party .meta { margin: .3rem 0; }

/* E'lonlar, Buyurtmalar, Fikrlar: the selling pages' own links. */
.sections { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.sections a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 1rem;
  border-radius: 999px; font: 600 15px "Inter", sans-serif;
  font-variant-numeric: tabular-nums; color: var(--tx); background: var(--s1);
}
.sections a[aria-current="page"] { color: var(--tx); background: var(--s3); }

/* ── Everyone gets a way out of the animation ───────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* The stepper (stepper.js): a count between a minus and a plus, on a sheet or in the page.
   Without the script it is the number field alone, with the browser's own arrows. */
.stepper { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 4px 0; }
.stepper-btn {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--s3);
  color: var(--tx); display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: transform 160ms var(--ease);
}
.stepper-btn:active { transform: scale(.97); }
.stepper-btn:disabled { color: var(--dis); cursor: default; transform: none; }
.stepper-input {
  width: 4ch; min-width: 0; min-height: 0; padding: 0; border: 0; background: none; box-shadow: none;
  text-align: center; font: 700 32px/1.1 "Inter", sans-serif; font-variant-numeric: tabular-nums;
  color: var(--tx); -moz-appearance: textfield; appearance: textfield;
}
.stepper-input::-webkit-outer-spin-button, .stepper-input::-webkit-inner-spin-button {
  -webkit-appearance: none; margin: 0;
}

/* Jo'natma (X06) and Vazn kiritish (X07) --------------------------------------------------- */

/* The status under the step tracker, and what a group holds that is not a row of its own: a
   form, the words of a package, a line's photos. */
.state { margin: 14px 4px 0; }
.grp-pad { padding: 16px; }
.grp-pad > :last-child, .line-extra > :last-child { margin-bottom: 0; }
.line-extra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 14px 14px; }
.line-extra details[open] { flex: 1 1 100%; }
.line-extra form { margin: 0; }
.line-extra details.typed { margin-top: 0; }

/* The next package, and how many are to come: its number large, the count a small pill that
   opens the sheet to change it. */
.turn { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 4px 0; }
.turn-n {
  margin: 0; font: 700 28px/1.1 "Inter", sans-serif; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.turn .pill { flex: none; }
/* The keypad's form: the hint, the figure, the weights already in, the keys, the two answers. */
.weigh-form { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
.weigh-form .sub { margin: 0 4px; }
.weigh-form .keypad-input { font-size: 56px; width: 7ch; }
.weigh-form .pill { width: 100%; }
.earlier {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; margin: 0; padding: 0;
  list-style: none; font-size: 13px; line-height: 1.4; color: var(--mu);
}
.earlier li { white-space: nowrap; }
/* A package's weight in the list, in a group: the row of the old pages, laid out as a cell. */
.grp .row.line { padding: 12px 14px; border-bottom: 1px solid var(--hair); gap: .5rem .8rem; }
.grp .row.line:last-child { border-bottom: 0; }
/* The live weight of a kit's reading, as large as the keypad's figure. */
#weigh .reading { font-size: 44px; line-height: 1.1; margin: 4px 0 8px; }
.plan-form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.plan-form .sub { margin: 0; }
/* What a shipment's receipt code is: its tile reads large, since it goes on every bag. */
.code-tile .cell-label { font-size: 24px; letter-spacing: .04em; line-height: 1.2; }
/* The receiver's Yetkazuvchi card sits under the group, on a group of its own. */
.grp-pad.party { margin-top: 12px; border-top: 0; }

/* Qabul kodi (X08) and Surat va bog'lash (X09) ------------------------------------------------ */

/* The code in its three boxes, what it is for under them, and what to write on paper: the
   figures side by side, each on a tile of its own, the value as large as the design draws it. A
   figure is never cut: a tile is at least as wide as its value (min-width: max-content), the
   tiles share the row equally while they all fit -- the drawing's three at 390px -- and one that
   would not fit goes on to the next row, whole, whatever the load weighs. */
.code-show { margin: 20px 0 0; }
.code-about { margin: 14px 28px 0; text-align: center; }
.figures { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 12px; }
.figure {
  flex: 1 1 0; min-width: max-content; padding: 12px 14px; display: flex; flex-direction: column;
  gap: 4px; border-radius: 14px; background: var(--s1); box-shadow: var(--raise);
}
.figure dt { font-size: 13px; line-height: 1.35; color: var(--mu); }
.figure dd {
  margin: 0; font: 700 clamp(22px, 7vw, 26px)/1.1 "Inter", sans-serif;
  font-variant-numeric: tabular-nums; letter-spacing: .01em; white-space: nowrap;
}

/* The line's photo: asked for, never required. The card says what to shoot and why; under it
   Suratsiz goes on to the ticks and Suratga olish is the file field, drawn as the pill. The
   field lies over the pill, unseen, so a tap reaches it and the keyboard focuses it. */
.photo-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 220px; margin: 16px 0 0; padding: 0 28px; text-align: center; border-radius: 14px;
  background: var(--s1); box-shadow: var(--raise);
}
.photo-ask {
  margin: 0; font: 600 15px/1.3 "Inter", sans-serif;
  font-variant-numeric: tabular-nums;
}
.photo-actions { display: flex; gap: 8px; margin: 12px 0 0; }
.photo-actions > .pill { flex: 1 1 0; }
.pill-file { position: relative; cursor: pointer; }
.pill-file input {
  position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%;
  min-height: 0; padding: 0; opacity: 0; cursor: pointer;
}
.pill-file:focus-within { outline: 2px solid var(--ac); outline-offset: 2px; }
.finish-photos { margin: 12px 0 0; }
.finish-bar { margin: 0 4px 4px; }
/* The guide's progress (X17): the bar, and how many steps it is under it. */
.guide-bar { margin: 0 4px 4px; }
.guide-bar .fine { margin: 6px 0 0; }

/* The two ticks: a row each, a ring to tap and a green tick once it is so. Each undone one is
   its own form with the row as its button, so one tap saves it. */
.checks > * { position: relative; }
.checks > * + *::before {
  content: ""; position: absolute; top: 0; left: 14px; right: 0; height: 1px; background: var(--hair);
}
.check-form { margin: 0; }
button.cell {
  width: 100%; border: 0; background: none; color: inherit; font: inherit; text-align: left;
  cursor: pointer;
}
button.cell:active { background: var(--press); }
.check-mark { flex: 0 0 26px; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; }
.check-done .check-mark { color: var(--ok); }
.check-open { border-radius: 50%; box-shadow: inset 0 0 0 2px var(--mu); }

/* Jo'natishdan oldin (X10) and the shipment on its way (X11) ----------------------------------- */

/* A check not yet as it should be is amber, ticked or not: the words beside it say which. */
.check-todo .check-mark { color: var(--warn); }
/* What becomes of a load nobody checks: under the code, a little below it. */
.road-note { margin-top: 18px; }

/* Hosil (X12), Yangi e'lon (X13) and a listing's page (X14) ------------------------------------ */

/* The head's action beside its picture: E'lon, the small pill, then the scene. */
.page-head-acts { display: flex; align-items: center; gap: 10px; flex: none; }

/* A listing's row on Hosil: its name and price, the bar under them, then what is there and the
   one status. The whole row is the link. */
.cell-listing { flex-direction: column; align-items: stretch; gap: 9px; padding-top: 13px; padding-bottom: 13px; }
.listing-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.listing-top .cell-label { min-width: 0; }
.listing-price { flex: none; font-size: 15px; font-weight: 700; white-space: nowrap; }
.listing-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; }
.listing-words { font-size: 13px; line-height: 1.35; color: var(--mu); }
.listing-words b { font-weight: 600; color: var(--tx); }
.listing-foot .dot { margin-left: auto; max-width: 100%; white-space: normal; }

/* A paused listing's row: its words are a link to it, Qayta ochish a button of its own. */
.cell > a.cell-body { color: inherit; }
.cell-act { margin: 0; flex: none; }

/* A field's unit after the figure typed: "kg", "so'm". */
.cell-unit { flex: none; font-weight: 500; color: var(--mu); }

/* A listing's price, large, with what it is per under it, and the small pill that changes it. */
.price-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 6px 4px 12px; }
.price { margin: 0; min-width: 0; }
.price-fig {
  display: block; font: 700 clamp(34px, 11vw, 46px)/1 "Inter", sans-serif;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em; white-space: nowrap;
}
.price-unit { display: block; margin-top: 4px; font-size: 14px; font-weight: 600; color: var(--mu); }

/* Three figures side by side, each its words under it (bor / band / sotuvda; ko'rsatildi /
   buyurtma / o'rtacha). What is on sale is the accent, as its bar is. */
.stock { display: flex; flex-direction: column; gap: 12px; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.kpi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi b {
  font: 700 20px/1.2 "Inter", sans-serif; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.kpi span { font-size: 13px; line-height: 1.35; color: var(--mu); }
.kpi-sale b { color: var(--ac); }
/* Two figures, side by side (Hisob-kitob: taken this week, taken this month). */
.kpis-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Hisob-kitob's one big figure, what is left to collect, with "so'm" small beside it. It
   shrinks a little on the narrowest phones and is never cut. */
.money-total { display: flex; flex-direction: column; gap: 4px; margin: 8px 4px 14px; }
.money-label { font-size: 13px; font-weight: 600; color: var(--mu); }
.money-big {
  margin: 0; font: 700 clamp(30px, 11vw, 48px)/1 "Inter", sans-serif;
  font-variant-numeric: tabular-nums; letter-spacing: -.03em;
}
/* The figure may wrap between its groups at 320px (a nine-digit sum), never scroll sideways;
   the unit stays whole. */
.money-big span {
  margin-left: 8px; font-size: 16px; font-weight: 700; letter-spacing: 0; color: var(--mu);
  white-space: nowrap;
}

/* The recount's form: its group, and the one small button under it. */
.recount { margin: 10px 0 0; }
.recount .pills { margin: 10px 0 0; align-items: flex-end; }
.recount .pills .pill { width: auto; }

/* Ferma (X16) and the scale kit ------------------------------------------------------------- */

/* A row that adds something, its words in the link colour: Yordamchi qo'shish. */
.cell-accent .cell-label { color: var(--ac); }

/* The helper's invite, shown once: the link is plain text a finger selects whole (a tap and
   hold takes all of it), in Inter like every figure, and the copy button under it is only
   there once copy.js shows it. */
.invite { display: flex; flex-direction: column; gap: 12px; }
.invite .fine { margin: 0; }
.invite-link {
  margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--s3); color: var(--tx);
  font-family: "Inter", sans-serif; font-size: 14px; font-weight: 500; line-height: 1.4;
  font-variant-numeric: tabular-nums; overflow-wrap: anywhere;
  -webkit-user-select: all; user-select: all;
}
