/* Gaucho: deep green ground, copper accent, cream text. One dark theme: the app is used behind a dim bar. */
/* Manrope (OFL), self-hosted as two variable files: Greek and Latin */
@font-face {
  font-family: "Gaucho Sans"; src: url("/fonts/sans-greek.woff2") format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0370-03FF, U+1F00-1FFF;
}
@font-face {
  font-family: "Gaucho Sans"; src: url("/fonts/sans-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root {
  --bg: #0f1e17;
  --surface: #172b22;      /* one step under the green of the sign */
  --raised: #20392e;
  --line: #264035;
  --tint: rgb(244 237 227 / .07);   /* wells: fields, chips, quiet buttons, on any ground */
  --tint-hi: rgb(244 237 227 / .12);
  --text: #f4ede3;
  --muted: #a7b8ab;
  --accent: #c98c71;       /* the copper of the wordmark */
  --accent-hi: #dca78e;
  --accent-text: #14261e;
  --ok: #8ccf9f;
  --warn: #e6b566;
  --bad: #f19483;
  --sans: "Gaucho Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: var(--sans);
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--line) transparent; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 500 16px/1.42 var(--sans);
  -webkit-font-smoothing: antialiased;
  caret-color: var(--accent);
  accent-color: var(--accent);
}
::selection { background: var(--accent); color: var(--accent-text); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.num { font-variant-numeric: tabular-nums lining-nums; }
.muted { color: var(--muted); }
h1, h2, h3 { text-wrap: balance; }
.ico { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid var(--line);
  background: var(--raised);
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 44px;
  transition: background-color .15s, border-color .15s;
}
a.btn { text-decoration: none; color: inherit; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); font-weight: 650; }
.btn.primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.small { min-height: 36px; padding: 6px 10px; font-size: 14px; border-radius: 8px; text-align: left; }
.btn.small .ico { width: 16px; height: 16px; }
label.btn { cursor: pointer; }
.field {
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
}
.field::placeholder, .qty::placeholder { color: var(--muted); opacity: 1; }
.field:focus, .qty:focus, .btn:focus-visible, .chip:focus-visible, .card:focus-visible,
.name:focus-visible, .back:focus-visible, .add:focus-visible, .stepper button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

/* page head with the sign's mark, then the sections of the app */
.brand { display: flex; align-items: flex-end; gap: 16px; padding: 22px 0 16px; }
.brand img { flex: none; height: 56px; width: auto; }
.brand h1 { margin: 0 0 1px; font: 800 30px/1.1 var(--display); letter-spacing: -.03em; }
/* sections of the app: a bar at the thumb */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .wrap { display: flex; padding: 0 4px; }
.tabbar a {
  flex: 1; min-width: 0; display: grid; justify-items: center; gap: 3px; padding: 9px 2px 8px;
  color: var(--muted); text-decoration: none; font-size: 11.5px; border-top: 2px solid transparent; margin-top: -1px;
}
.tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar .ico { width: 22px; height: 22px; }
.tabbar a:hover { color: var(--text); }
.tabbar a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.home { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
.tabbar a[aria-current="page"] { color: var(--accent-hi); border-top-color: var(--accent); }

/* list of counts and invoices */
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 10px;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s;
}
.card:hover { border-color: var(--accent); }
.card .top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card .date { font-weight: 600; font-size: 17px; }
.card .total { font: 700 22px/1.2 var(--display); letter-spacing: -.02em; white-space: nowrap; }
.card .sub { display: flex; justify-content: space-between; gap: 12px; margin-top: 4px; font-size: 14px; color: var(--muted); }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--raised); color: var(--muted); white-space: nowrap; }
.badge.open { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--accent-hi); }
.up { color: var(--ok); }
.down { color: var(--bad); }
.newcount { display: flex; gap: 8px; margin: 18px 0 32px; }
.newcount .field { flex: 1; }

/* count view */
.bar {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 8px 0 10px;
}
.bar .row1 { display: flex; align-items: center; gap: 8px; }
.bar h1 { font: 700 21px/1.2 var(--display); letter-spacing: -.02em; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-wrap: nowrap; }
.back {
  display: flex; align-items: center; border: 0; background: none; color: var(--accent);
  padding: 6px 8px 6px 0; min-height: 44px; border-radius: 8px; text-decoration: none;
}
.back .ico { width: 24px; height: 24px; }
.bar .row2 { display: flex; gap: 8px; margin-top: 8px; }
.bar .row2 .field { min-width: 0; background: var(--surface); }
.bar select.field { flex: 0 0 38%; }
.chips { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.chip {
  flex: none; border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 99px; padding: 6px 12px; font-size: 14px; min-height: 36px;
  transition: background-color .15s, color .15s, border-color .15s;
}
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }

.cat { margin-top: 26px; }
.cat h2, h2.section {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  font: 700 19px/1.2 var(--display); letter-spacing: -.02em; color: var(--text);
  margin: 0 0 8px; padding: 0 2px;
}
.cat h2 [data-sub], h2.section .num { font: 500 14px/1.2 var(--sans); color: var(--accent); white-space: nowrap; }
h2.section { margin: 30px 0 10px; }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .info { flex: 1; min-width: 0; }
.row .name {
  display: block; width: 100%; text-align: left; border: 0; background: none; padding: 0;
  font-weight: 500; overflow-wrap: anywhere; border-radius: 4px;
}
.row .meta { font-size: 13px; color: var(--muted); margin-top: 1px; }
.row .meta .noprice { color: var(--warn); }
.row .meta strong { color: var(--accent-hi); }
.qty {
  flex: none; width: 84px; min-height: 44px; text-align: right;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg);
  padding: 8px 10px; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.qty:disabled { opacity: 1; border-color: transparent; background: transparent; }
.row.todo .qty { border-style: dashed; }
.row.invalid .qty { border-color: var(--bad); color: var(--bad); }
.row.unsaved .qty { border-color: var(--warn); }
.add {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-top: 1px solid var(--line);
  background: none; padding: 12px 14px; text-align: left; color: var(--accent); min-height: 44px;
}
.add .ico { width: 18px; height: 18px; }

.foot {
  position: sticky; bottom: 0; z-index: 5; margin-top: 24px;
  background: var(--surface); border-top: 1px solid var(--accent);
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
}
.foot .wrap { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.foot .total { font: 700 26px/1.15 var(--display); letter-spacing: -.02em; color: var(--accent-hi); }
.foot .small { font-size: 13px; color: var(--muted); }
.sync { color: var(--warn); }

table.summary { width: 100%; border-collapse: collapse; font-size: 14px; }
.summary th, .summary td { padding: 9px 4px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.summary td:first-child { white-space: normal; overflow-wrap: break-word; }
.summary th:first-child, .summary td:first-child { text-align: left; }
.summary th { font-size: 13px; color: var(--muted); font-weight: 500; }
.summary tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--accent); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

dialog {
  border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text);
  padding: 20px; width: min(440px, calc(100vw - 32px));
  box-shadow: 0 18px 50px rgb(0 0 0 / .45);
}
dialog::backdrop { background: rgb(6 14 10 / .68); }
dialog h3 { margin: 0 0 14px; font: 700 22px/1.2 var(--display); letter-spacing: -.02em; }
dialog label { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
dialog label.btn { display: inline-flex; margin: 0; font-size: 14px; color: var(--text); }
dialog .check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 15px; }
dialog .btns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
dialog .err { color: var(--bad); font-size: 14px; margin-top: 10px; min-height: 1em; }
dialog .btnrow { align-items: center; margin-top: 12px; }
dialog .btnrow .err { margin: 0; color: var(--muted); }

.login { max-width: 340px; margin: 9vh auto 0; padding: 0 16px; text-align: center; }
.login img { width: 168px; height: 168px; }
.login h1 { font: 700 28px/1.1 var(--display); letter-spacing: -.02em; margin: 18px 0 20px; }
.login .btn { width: 100%; margin-top: 10px; }

/* report: the period as a ledger that ends in the cost of stock */
.kpis { border-top: 1px solid var(--line); }
.kpi {
  display: grid; grid-template-columns: 1fr auto; column-gap: 16px; align-items: baseline;
  padding: 11px 2px; border-bottom: 1px solid var(--line); min-width: 0;
}
.kpi .label { font-size: 15px; }
.kpi .value { grid-column: 2; grid-row: 1; font-size: 17px; font-weight: 600; white-space: nowrap; }
.kpi .sub { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.kpi .sub:empty { display: none; }
.kpi.strong { border-bottom-color: var(--accent); padding: 14px 2px; }
.kpi.strong .label { font: 700 20px/1.2 var(--display); letter-spacing: -.02em; }
.kpi.strong .value { font: 700 28px/1.1 var(--display); letter-spacing: -.02em; color: var(--accent-hi); }
.kpi.bad .value { color: var(--bad); }
.notes { margin: 18px 0 0; padding: 12px 14px 12px 30px; border: 1px solid var(--line); border-radius: 14px; background: var(--raised); font-size: 14px; }
.notes li + li { margin-top: 6px; }
.notes li::marker { color: var(--accent); }
.notes a, p a { color: var(--accent-hi); text-underline-offset: 3px; }
.row .side { flex: none; text-align: right; font-weight: 600; }
.row .side .muted { font-weight: 400; font-size: 13px; }
.stack { display: grid; gap: 8px; margin: 0 0 18px; }
.pair { display: flex; gap: 8px; }
.pair > * { flex: 1; min-width: 0; }
.pair > .btn { flex: none; }
.lbl { display: block; font-size: 13px; color: var(--muted); margin-top: 6px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.err { color: var(--bad); font-size: 14px; min-height: 1em; }
.btnrow { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
dialog .part { margin-bottom: 8px; }
.bar + main > .stack:first-child { margin-top: 16px; }
.rows + .stack { margin-top: 14px; }
.home > p.muted { max-width: 68ch; }

/* bottle gauge */
.liquid { fill: var(--accent); opacity: .9; }
.glass { fill: none; stroke: var(--text); stroke-width: 5; stroke-linejoin: round; }
.bottle {
  flex: none; width: 34px; height: 52px; padding: 2px; border: 0; background: none; border-radius: 8px;
}
.bottle svg { width: 100%; height: 100%; display: block; }
.bottle .glass { stroke-width: 12; stroke: var(--muted); }
.bottle.photo { width: 38px; height: 76px; padding: 2px 0; overflow: hidden; background: var(--bg); }
.bottle.photo img { display: block; width: 100%; height: 100%; object-fit: contain; }
.bottle:disabled { cursor: default; }
.bottle:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
dialog.sheet {
  margin: auto auto 0; width: 100%; max-width: 520px; border-radius: 22px 22px 0 0; border-bottom: 0;
  border-top-color: var(--accent);
  padding: 18px 18px calc(16px + env(safe-area-inset-bottom)); max-height: 100dvh; overflow-y: auto;
}
dialog.sheet h3 { margin-bottom: 2px; }
.gauge { display: flex; align-items: center; gap: 22px; margin-top: 14px; }
.bigbottle { flex: none; height: min(46vh, 340px); aspect-ratio: 120 / 320; touch-action: none; cursor: ns-resize; border-radius: 12px; }
.bigbottle.photo { background: var(--bg); overflow: hidden; }
.bigbottle.photo .liquid { opacity: .34; }
.bigbottle.photo .tick { stroke: var(--text); opacity: .7; }
.bigbottle:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.bigbottle .tick { stroke: var(--muted); stroke-width: 2; }
#mark line { stroke: var(--accent-hi); stroke-width: 3; }
#mark circle { fill: var(--accent-hi); stroke: var(--bg); stroke-width: 3; }
.readout { flex: 1; min-width: 0; }
.readout .lbl { margin-top: 14px; }
.readout .lbl:first-child { margin-top: 0; }
.big { font: 700 32px/1.15 var(--display); letter-spacing: -.02em; }
.big.total { color: var(--accent-hi); }
#lvlsub { font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--raised);
}
.stepper button:active { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.stepper .big { min-width: 1.5ch; text-align: center; }
.hint { margin: 12px 0 0; font-size: 14px; }

/* order, invoice scan */
.parbox { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: var(--muted); }
.parbox .qty { width: 72px; }
.field.mini { min-height: 36px; padding: 4px 8px; font-size: 14px; margin-top: 6px; max-width: 220px; }
.scanlines { max-height: 56vh; overflow-y: auto; display: grid; gap: 14px; padding-right: 2px; }
.scanline { display: grid; gap: 6px; font-size: 14px; }

/* storage areas, quick fills, shelf order, count sheet */
.chips.areas .chip { border-radius: 8px; }
.chips.areas .chip[aria-pressed="true"] { background: var(--raised); color: var(--text); border-color: var(--accent); }
.chip .ico { width: 16px; height: 16px; display: block; }
.h2side { display: flex; align-items: baseline; gap: 12px; }
.zero {
  border: 0; background: none; padding: 4px 0; color: var(--muted);
  font: 400 13px/1.2 system-ui, sans-serif; text-decoration: underline dotted; text-underline-offset: 3px;
}
.zero:hover, .same:hover { color: var(--accent-hi); }
.same {
  border: 0; background: none; padding: 3px 0; margin: -3px 0; color: var(--accent-hi); font: inherit;
  text-decoration: underline dotted; text-underline-offset: 3px;
}
.zero:focus-visible, .same:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.handle { display: none; flex: none; place-items: center; width: 36px; height: 44px; margin-left: -8px; color: var(--muted); touch-action: none; cursor: grab; }
.handle .ico { stroke-width: 3; }
.reorder .handle { display: grid; }
.reorder .qty, .reorder .bottle, .reorder .add { display: none; }
.reorder .row { user-select: none; }
.row.dragging { background: var(--raised); box-shadow: 0 8px 22px rgb(0 0 0 / .4); position: relative; z-index: 2; }
.row.dragging .handle { color: var(--accent-hi); cursor: grabbing; }
.footbtns { display: flex; gap: 8px; flex: none; }
.sheethead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.sheethead h3 { min-width: 0; }
.sheethead span { flex: none; font-size: 14px; }
.bigphoto { flex: none; height: min(34vh, 250px); aspect-ratio: 120 / 320; object-fit: cover; border-radius: 12px; background: var(--bg); }
.counts .qty.total { width: 128px; min-height: 52px; text-align: left; font: 700 30px/1.1 var(--display); letter-spacing: -.02em; color: var(--accent-hi); }
.counts .qty.bad { border-color: var(--bad); color: var(--bad); }

/* count header slides away on the way down the list; the storage areas stay */
.bar { transition: transform .26s var(--ease); }
.bar.compact { transform: translateY(calc(-1 * var(--hide, 0px))); }
.bar .areas { margin-top: 8px; }
@media (prefers-reduced-motion: reduce) { .bar { transition: none; } }

/* items counted in cases: a crate where bottles have a bottle */
.bottle.crate { display: grid; place-items: center; color: var(--muted); }
.bottle.crate .ico { width: 26px; height: 26px; stroke-width: 1.5; }

/* product shots come on white: on cream and multiplied they sit in the dark page instead of glaring */
.bottle.photo, .bigphoto { background: #d9d1c1; }
.bottle.photo img, .bigphoto { mix-blend-mode: multiply; }
.bigbottle .paper { fill: #d9d1c1; }
.bigbottle image { mix-blend-mode: multiply; }
.bigbottle.photo .air { fill: #14261e; opacity: .58; }
.bigbottle.photo .liquid { opacity: .12; }
#mark .under { stroke: var(--bg); stroke-width: 7; }
#marktext {
  font: 700 15px var(--sans); fill: var(--accent-hi);
  paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round;
}

/* home: value of stock per count. One series; bars rise from a zero baseline */
.chart { display: flex; align-items: stretch; gap: 10px; height: 190px; padding-top: 4px; border-bottom: 1px solid var(--line); }
.chart .col {
  flex: 1; min-width: 0; max-width: 84px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center;
  color: inherit; text-decoration: none; position: relative; padding-bottom: 0;
}
.chart .barv { width: min(100%, 40px); background: var(--accent); border-radius: 4px 4px 0 0; transition: background-color .15s; }
.chart .col.open .barv { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.chart .col:hover .barv, .chart .col:focus-visible .barv { background: var(--accent-hi); }
.chart .col.open:hover .barv { background: color-mix(in srgb, var(--accent) 30%, transparent); }
.chart .col:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.chart .val { font-size: 12.5px; color: var(--text); margin-bottom: 5px; white-space: nowrap; }
.chart .tick { position: absolute; top: 100%; margin-top: 6px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.chart + .chartnote, .chart + h2.section { margin-top: 40px; }
.chart { margin-bottom: 28px; }
.chartnote { font-size: 13px; margin: 0; }
h2.section .more { font: 500 14px/1.2 var(--sans); color: var(--accent-hi); text-underline-offset: 3px; }

/* catalogue upkeep */
.row.pick { cursor: pointer; }
.row.pick input { flex: none; width: 20px; height: 20px; }
.row.pick .name, .row.pick .meta { display: block; }

/* the sheet rises from the bar top; nothing else moves */
@media (prefers-reduced-motion: no-preference) {
  dialog.sheet[open] { animation: rise .34s var(--ease); }
  dialog.sheet[open]::backdrop { animation: dim .25s ease-out; }
}
@keyframes rise { from { transform: translateY(48px); opacity: 0; } }
@keyframes dim { from { opacity: 0; } }

/* count sheet: the bottle is the screen. Whole product shot on a wide panel, level line from edge to edge */
.stage {
  --ln: var(--accent-hi); --ink: var(--bg);
  position: relative; height: clamp(240px, 47dvh, 440px); margin-top: 12px; border-radius: 16px; overflow: hidden;
  background: var(--bg); display: grid; place-items: center; user-select: none;
}
.stage.paper { --ln: #14261e; --ink: #f4ede3; background: #d9d1c1; }
.stage.slide { touch-action: none; cursor: ns-resize; }
.stage.flat { height: 120px; color: var(--muted); }
.stage:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.stage .shot, .stage .bigbottle { position: absolute; top: 0; left: 50%; height: 100%; width: auto; transform: translateX(-50%); pointer-events: none; }
.stage .shot { aspect-ratio: 3 / 8; object-fit: contain; mix-blend-mode: multiply; }
.stage .bigbottle { aspect-ratio: 120 / 320; border-radius: 0; }
.stage .bigcrate .ico { width: 56px; height: 56px; stroke-width: 1.2; }
.stage .fill {
  position: absolute; inset: 0; pointer-events: none; mix-blend-mode: multiply;
  background: linear-gradient(rgb(201 140 113 / .5), rgb(201 140 113 / .22));
}
.level { position: absolute; left: 0; right: 0; top: 0; height: 0; pointer-events: none; }
.level::before { content: ""; position: absolute; left: 10px; right: 10px; top: -1.5px; height: 3px; border-radius: 2px; background: var(--ln); }
.level i {
  position: absolute; top: -9px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--ln); box-sizing: border-box;
}
.level i:first-child { left: 4px; }
.level i:nth-child(2) { right: 4px; }
.level b {
  position: absolute; left: 28px; bottom: 9px; padding: 3px 9px; border-radius: 999px;
  background: var(--ln); color: var(--ink); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.level.low b { bottom: auto; top: 9px; }
.sizechip {
  position: absolute; top: 10px; right: 10px; padding: 3px 10px; border-radius: 999px;
  background: var(--accent); color: var(--accent-text); font-size: 13px; font-weight: 600;
}
.stage .side, .stage .shoot {
  position: absolute; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid rgb(20 38 30 / .18); background: rgb(244 237 227 / .82); color: #14261e; margin: 0; cursor: pointer;
}
.stage:not(.paper) .side, .stage:not(.paper) .shoot { background: var(--raised); color: var(--text); border-color: var(--line); }
.stage .side { top: calc(50% + 30px); }
.stage.flat .side { top: calc(50% - 22px); }
.stage.flat .shoot { left: auto; right: 64px; top: calc(50% - 20px); }
.stage .side.prev { left: 10px; }
.stage .side.next { right: 10px; }
.stage .side:disabled { opacity: .3; }
.stage .shoot { left: 10px; top: 10px; width: 40px; height: 40px; }
.stage .shoot .ico { width: 20px; height: 20px; }
.stage .side:focus-visible, .stage .shoot:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.counts { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 12px; }
.counts .lbl { margin: 0 0 4px; }
dialog.sheet .btns { margin-top: 14px; }
dialog.sheet .btns .btn.primary { flex: 1; justify-content: center; }

/* month close: the open points of the period, one line each, settled top to bottom */
.lead { margin: 18px 0 6px; }
.steps { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 30px 1fr auto; gap: 4px 12px; align-items: start; padding: 14px 2px; border-bottom: 1px solid var(--line); }
.step .mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; margin-top: 1px;
  font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.step.ok .mark { color: var(--ok); border: 1px solid color-mix(in srgb, var(--ok) 45%, transparent); }
.step.ok .mark .ico { width: 16px; height: 16px; }
.step.warn .mark { background: var(--warn); color: var(--accent-text); }
.step h2 { margin: 0; font: 700 19px/1.3 var(--display); letter-spacing: -.02em; }
.step p { margin: 2px 0 0; font-size: 14px; color: var(--muted); max-width: 60ch; }
.step.warn p { color: var(--text); }
.step .act { align-self: center; }
.step .rows { margin-top: 10px; }
.step .row.pick { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; color: inherit; font: inherit; }
.step .row.pick:first-child { border-top: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* order: one message per supplier */
.grouphead { margin: 0 0 10px; }
.pair.bulk { margin-top: 12px; }

/* the report on paper or saved as PDF: ink on white, only the figures */
.printonly { display: none; }
@media print {
  :root {
    --bg: #fff; --surface: #fff; --raised: #fff; --line: #c9c9c9; --text: #111; --muted: #555;
    --accent: #7a4a33; --accent-hi: #7a4a33; --ok: #1d6b34; --warn: #7a5a00; --bad: #a3271b;
  }
  @page { margin: 14mm; }
  body { background: #fff; color: #111; font-size: 11pt; }
  .printonly { display: inline; }
  .bar { position: static; transform: none !important; border: 0; background: none; }
  .bar h1 { white-space: normal; overflow: visible; }
  .back, .badge, .actions, .chips, .tabbar, .foot, dialog, .notes a { display: none !important; }
  html, body { width: auto; overflow: visible; }
  .wrap { max-width: none; padding: 0 6px; box-sizing: border-box; }
  /* the long tail stays in the xlsx: paper gets the 40 items that carry the money */
  #usage .row:nth-child(n+41), #usage > p { display: none; }
  .rows { border-radius: 0; border-left: 0; border-right: 0; }
  .row, .kpi, tr { break-inside: avoid; }
  h2.section { break-after: avoid; margin-top: 18pt; }
  .notes { background: none; }
}

/* message above the bottom bar, with undo */
#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); z-index: 60;
  display: flex; align-items: center; gap: 12px; max-width: min(92vw, 460px); padding: 10px 12px 10px 16px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-size: 15px; box-shadow: 0 10px 30px rgb(0 0 0 / .45);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .28s var(--ease);
}
#toast.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#toast span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#toast .btn { flex: none; background: var(--bg); color: var(--text); border-color: var(--bg); }

/* home: the count in progress */
.nextup { margin: 16px 0 6px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--accent); }
.nextup .big { margin: 2px 0 10px; }
.nextup .actions { margin: 14px 0 0; }
.meter { height: 6px; border-radius: 3px; background: var(--bg); overflow: hidden; margin-bottom: 8px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* optional line of the close checklist */
.step.plain .mark { color: var(--muted); border: 1px dashed var(--line); }
.step.plain .mark .ico { width: 14px; height: 14px; }

/* menu rows and rows that do not count */
.row.menu { color: inherit; text-decoration: none; padding: 14px; }
.row.menu .name, .row.menu .meta { display: block; }
.row.menu > .ico { color: var(--muted); flex: none; }
.row.off .name, .row.off .side { color: var(--muted); text-decoration: line-through; }
.stack .lbl { margin: 0 0 4px; }

/* one item across the counts */
.spark { display: flex; align-items: flex-end; gap: 6px; height: 96px; margin: 6px 0 4px; padding-top: 16px; }
.scol { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); }
.scol i { display: block; width: 100%; max-width: 34px; min-height: 2px; background: var(--accent); border-radius: 4px 4px 0 0; }
.scol span { color: var(--text); font-weight: 600; }
.scol b { font-weight: 400; white-space: nowrap; }

/* ---- 2026-12 look: one sans, soft filled surfaces in place of outlines, floating tab bar ---- */
.btn { border-color: transparent; background: var(--tint-hi); border-radius: 14px; font-weight: 650; padding: 10px 16px; }
.btn:hover { border-color: transparent; background: rgb(244 237 227 / .18); }
.btn.primary:hover { border-color: transparent; }
.btn.ghost { background: transparent; border-color: var(--line); font-weight: 500; }
.btn.small { border-radius: 10px; padding: 6px 12px; }
.btn:active { transform: scale(.97); }
.field, .qty { border-color: transparent; background: var(--tint); border-radius: 14px; }
.field { padding: 11px 14px; }
.qty { border-radius: 12px; font-weight: 700; }
.bar .row2 .field { background: var(--tint); }
.row.todo .qty { border: 1px dashed rgb(244 237 227 / .22); background: transparent; }
.row.invalid .qty { border-color: var(--bad); }
.row.unsaved .qty { border-color: var(--warn); }
.qty:disabled { background: transparent; }
select.field { appearance: none; padding-right: 34px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.chip { border-color: transparent; background: var(--tint); color: var(--text); font-weight: 500; padding: 7px 14px; }
.chip[aria-pressed="true"] { font-weight: 700; }
.chips { gap: 8px; }
.rows, .card { border: 0; border-radius: 20px; }
.card { padding: 16px 18px; transition: background-color .15s; }
.card:hover { background: var(--raised); }
.card .date { font-weight: 700; }
.row { padding: 10px 12px 10px 16px; }
.row .name { font-weight: 600; }
.badge { font-weight: 700; padding: 3px 10px; }
.cat h2, h2.section { font-size: 20px; }
.kpi .value { font-weight: 800; }
.kpi.strong .value { font-size: 32px; font-weight: 800; }
.foot { border-top: 0; box-shadow: 0 -1px 0 var(--line), 0 -14px 30px rgb(0 0 0 / .28); }
.foot .total { font-weight: 800; }
.bar { background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: transparent; box-shadow: 0 1px 0 var(--line); }
.bar h1 { font-size: 20px; }
dialog { border: 0; border-radius: 24px; }
dialog.sheet { border-radius: 28px 28px 0 0; border-top: 0; }
.notes { border: 0; border-radius: 18px; background: var(--tint); }
.stepper button { border: 0; background: var(--tint-hi); border-radius: 16px; width: 52px; height: 52px; }
.stage { border-radius: 22px; }
.summary th { font-weight: 600; }
.step .mark { font-weight: 800; }
.nextup { border: 0; border-radius: 24px; background: var(--surface); padding: 20px; }
.nextup .big { font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.meter { height: 8px; border-radius: 4px; background: var(--tint); }
.meter i { border-radius: 4px; }
.big { font-weight: 800; }
.brand { padding: 26px 0 18px; }

/* tab bar: a floating island; the current section is a filled pill */
.tabbar {
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding: 6px; border: 0; border-radius: 26px;
  background: color-mix(in srgb, var(--raised) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 34px rgb(0 0 0 / .5), inset 0 0 0 1px rgb(244 237 227 / .06);
  max-width: 560px; margin: 0 auto;
}
.tabbar .wrap { padding: 0; gap: 2px; }
.tabbar a { border-top: 0; margin: 0; border-radius: 20px; padding: 8px 2px 7px; font-size: 11px; font-weight: 600; transition: background-color .2s, color .2s; }
.tabbar a[aria-current="page"] { background: var(--accent); color: var(--accent-text); border-top-color: transparent; }
.tabbar a:focus-visible { border-radius: 20px; }
.home { padding-bottom: calc(108px + env(safe-area-inset-bottom)); }
#toast { bottom: calc(108px + env(safe-area-inset-bottom)); border-radius: 18px; font-weight: 600; }
@media print { .bar { backdrop-filter: none; box-shadow: none; } }
.foot .total { font-size: 23px; white-space: nowrap; }
.foot .wrap { gap: 10px; }
.footbtns .btn { padding: 10px 13px; }
.tabbar a { font-size: 10.5px; letter-spacing: -.01em; }

/* ---- v3: quieter ground. Copper marks the one action and the one figure of a screen; choices are cream ---- */
/* page head: small mark, title, then the screens of the tab */
.top { display: flex; align-items: center; gap: 12px; padding: 14px 0 12px; }
.top img { flex: none; height: 30px; width: auto; }
.top h1 { flex: 1; min-width: 0; margin: 0; font: 800 24px/1.15 var(--display); letter-spacing: -.03em; }
.whobtn { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 12px; border: 0; border-radius: 99px; background: var(--tint); color: var(--muted); font-size: 14px; font-weight: 600; max-width: 42vw; }
.whobtn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.whobtn .ico { width: 18px; height: 18px; }
.seg { display: flex; gap: 4px; margin: 0 -16px 16px; padding: 0 16px; overflow-x: auto; scrollbar-width: none; box-shadow: inset 0 -1px 0 var(--line); }
.seg a { flex: none; padding: 9px 12px 11px; color: var(--muted); text-decoration: none; font-size: 15px; font-weight: 600; border-bottom: 2px solid transparent; }
.seg a[aria-current="page"] { color: var(--text); border-bottom-color: var(--text); }
.seg a:focus-visible, .whobtn:focus-visible, .iconbtn:focus-visible, .arearow:focus-visible, .mhead:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.wrap > .wrap { padding: 0; }

/* tab bar: three places, the current one is a cream-tinted pill */
.tabbar { max-width: 380px; }
.tabbar a { flex-direction: row; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 6px; font-size: 14px; font-weight: 700; letter-spacing: 0; }
.tabbar a[aria-current="page"] { background: var(--tint-hi); color: var(--text); }
.tabbar .ico { width: 20px; height: 20px; }

/* choices are cream, not copper */
.chip[aria-pressed="true"], .chips.areas .chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: transparent; font-weight: 700; }
.chips.areas .chip { border-radius: 99px; }
.back { color: var(--text); }
.cat h2 [data-sub], h2.section .num { color: var(--muted); }
.same { color: var(--muted); }
.foot .total { color: var(--text); }
.btn.wide { width: 100%; min-height: 54px; font-size: 17px; border-radius: 16px; }
h2.section { font-size: 15px; font-weight: 700; letter-spacing: 0; color: var(--muted); text-transform: none; margin: 28px 0 10px; }
.cat h2 { font-size: 17px; margin-bottom: 6px; }
.cat { margin-top: 20px; }

/* month: the count in progress, then the path */
.hero { margin: 4px 0 0; padding: 20px; border-radius: 24px; background: var(--surface); }
.hero .lbl { margin: 0; font-size: 14px; }
.hero .big { margin: 4px 0 14px; font: 800 36px/1.05 var(--display); letter-spacing: -.035em; }
.hero .meter { margin-bottom: 8px; }
.hero .btn.wide { margin-top: 16px; }
.areapick { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.areapick .lbl { margin-bottom: 6px; }
.arearow { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 6px 0; border: 0; background: none; text-align: left; }
.arearow .aname { flex: 1; font-weight: 700; }
.arearow .muted { font-size: 14px; }
.arearow .ico, .mhead > .ico { color: var(--muted); width: 18px; height: 18px; }
.msteps { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: 20px; overflow: hidden; }
.mstep + .mstep { border-top: 1px solid var(--line); }
.mhead { display: flex; align-items: center; gap: 12px; padding: 13px 14px; color: inherit; text-decoration: none; }
.mstep .mark { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 14px; font-weight: 800; color: var(--muted); background: var(--tint); }
.mstep.now .mark { background: var(--accent); color: var(--accent-text); }
.mstep.done .mark { color: var(--ok); }
.mstep .mark .ico { width: 16px; height: 16px; stroke-width: 2.4; }
.minfo { flex: 1; min-width: 0; display: grid; }
.mtitle { font-weight: 700; }
.mtext { font-size: 14px; color: var(--muted); }
.home > p.muted a { color: var(--text); text-underline-offset: 3px; }
.home > p.muted { margin-top: 16px; font-size: 14px; }
.newcount { margin: 12px 0 8px; }
.kpis { margin-top: 22px; }

/* count list: search and one filter button; everything else behind it */
.bar { padding: 4px 0 8px; }
.bar .row2 { margin-top: 2px; }
.bar .row2 .field { flex: 1; }
.filterbtn { flex: none; gap: 8px; padding: 10px 14px; font-weight: 600; background: var(--tint); }
.filterbtn.on { background: var(--text); color: var(--bg); }
.filters { margin-top: 8px; padding: 12px; border-radius: 16px; background: var(--surface); }
.filters .chips { margin: 0 0 10px; flex-wrap: wrap; }
.bar .filters select.field { flex: none; width: 100%; }
.bar .areas { margin-top: 8px; }

/* rows: picture, two lines, quantity. Nine to a screen */
#list .rows { border-radius: 16px; }
#list .row { gap: 12px; padding: 7px 10px 7px 10px; min-height: 62px; }
#list .row .name { font-size: 15px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#list .row .meta { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#list .qty { width: 72px; min-height: 44px; font-size: 17px; }
.bottle, .bottle.photo, .bottle.crate { width: 36px; height: 48px; padding: 4px 8px; border-radius: 10px; background: var(--tint); }
.bottle.photo { padding: 2px; background: #d9d1c1; }
.bottle .glass { stroke-width: 10; stroke: rgb(244 237 227 / .5); fill: rgb(244 237 227 / .06); }
.bottle.crate { padding: 0; }
.bottle.crate .ico { width: 22px; height: 22px; }
.add { padding: 10px 14px; color: var(--muted); font-size: 14px; }
.foot .total { font-size: 20px; }
.footbtns .btn.primary { padding: 10px 16px 10px 20px; }

/* counting run: one item fills the screen; the thumb rests on Next */
dialog.sheet { width: 100%; max-width: 560px; height: 100dvh; max-height: 100dvh; margin: 0 auto; border-radius: 0; padding: 0; background: var(--bg); overflow: hidden; box-shadow: none; }
.run { display: flex; flex-direction: column; height: 100%; padding: calc(8px + env(safe-area-inset-top)) 16px calc(14px + env(safe-area-inset-bottom)); }
.runtop { display: flex; align-items: center; gap: 12px; }
.iconbtn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--tint); margin-left: -4px; }
.runprog { flex: 1; min-width: 0; }
.rl { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.rl span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl b { color: var(--text); font-weight: 700; }
.runprog .meter { height: 4px; margin: 0; }
.runprog .meter i { background: var(--text); }
.runname { margin-top: 14px; }
.runname h3 { margin: 0 0 2px; font-size: 22px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.runname .muted { font-size: 14px; }
.run .stage { flex: 1 1 0; min-height: 150px; height: auto; margin-top: 12px; background: var(--surface); }
.run .stage.paper { background: #d9d1c1; }
.run .stage.flat { flex: 0 1 200px; }
.run .stage .bigcrate .ico { width: 72px; height: 72px; }
.bigbottle .glass { stroke-width: 3; stroke: rgb(244 237 227 / .55); fill: rgb(244 237 227 / .05); }
.stage .shoot { left: 10px; top: 10px; width: 40px; height: 40px; }
.stage .shoot.ask { width: auto; display: inline-flex; gap: 8px; padding: 0 14px 0 12px; border-radius: 99px; font-size: 14px; font-weight: 600; background: var(--tint-hi); color: var(--text); border-color: transparent; }
.stage.flat .shoot { left: 10px; right: auto; top: 10px; }
.run .counts { margin-top: 14px; align-items: flex-end; }
.run .counts .qty.total { width: 132px; min-height: 52px; color: var(--text); }
.run .stepper button { width: 56px; height: 52px; }
.quick { display: flex; gap: 8px; margin-top: 12px; }
.quick .btn { flex: 1; min-height: 50px; white-space: nowrap; }
.quick .btn[data-set="0"] { flex: 0 0 34%; }
.run > .err { display: block; min-height: 0; font-size: 13px; color: var(--muted); }
.run > .err:empty { display: none; }
dialog.sheet .btns { display: flex; gap: 8px; margin-top: 10px; }
dialog.sheet .btns .btn { min-height: 58px; border-radius: 18px; }
dialog.sheet .btns .btn:first-child { flex: 0 0 62px; }
dialog.sheet .btns .btn.primary { flex: 1; font-size: 18px; }
.stage.flat + .counts { margin-top: auto; }
@media (prefers-reduced-motion: no-preference) { dialog.sheet[open] { animation: rise .26s var(--ease); } }
@media (min-width: 600px) { dialog.sheet { height: min(100dvh, 900px); margin: auto; border-radius: 28px; } }
.foot .small { white-space: nowrap; }
.run .stage.flat { flex: 1 1 0; }
.run .stage .bigcrate .ico { width: 120px; height: 120px; stroke-width: .8; color: rgb(244 237 227 / .35); }
.stage.flat + .counts { margin-top: 14px; }
.card { padding: 12px 16px; margin-bottom: 8px; border-radius: 16px; }
.card .total { font-size: 18px; }
.card .date { font-size: 16px; }
.card .sub { margin-top: 2px; font-size: 13px; }

/* v3, second pass: purchases, order, money, close */
.actions.two, .actions.three { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 4px 0 8px; }
.actions.three { grid-template-columns: 1fr 1fr 1fr; margin: 16px 0; }
.actions.two .btn, .actions.three .btn { min-height: 50px; padding: 10px 8px; }
.hero .actions.two { margin: 16px 0 0; }
.panel { padding: 12px; border-radius: 16px; background: var(--surface); margin: 0 0 8px; }
#scan-state { margin: 0; font-size: 14px; }
#scan-state:empty { display: none; }
h2.section .num { font: 600 14px/1.2 var(--sans); }
.row.menu .side { font-size: 15px; }
.lead0 { margin: 0 0 12px; font-size: 14px; }
.hero .big.accent { color: var(--accent-hi); }
.hero .big { text-wrap: balance; }
.closing .hero .big { margin-bottom: 6px; }
.closing { padding-bottom: 8px; }
.closing .steps { border-top: 0; background: var(--surface); border-radius: 20px; padding: 2px 14px; }
.closing .steps + .steps { margin-top: 10px; }
.closing .step:last-child { border-bottom: 0; }
.closing .step h2 { font-size: 17px; }
.closing .step .rows { background: var(--tint); border-radius: 14px; }
.oks { list-style: none; margin: 0; padding: 4px 14px; background: var(--surface); border-radius: 20px; }
.oks li { display: flex; gap: 10px; padding: 10px 0; font-size: 14px; color: var(--muted); }
.oks li + li { border-top: 1px solid var(--line); }
.oks .ico { color: var(--ok); width: 18px; height: 18px; margin-top: 1px; }
.oks b { color: var(--text); font-weight: 700; margin-right: 4px; }
.foot .small br + * { white-space: nowrap; }
.bar + main > .hero:first-child { margin-top: 14px; }
.hero + .field, .hero + input { margin-top: 12px; }
.home > .hero { margin-bottom: 12px; }

/* v3, third pass: report and invoice. Sections fold; the figure of the screen sits on top */
.hline { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 15px; }
.hline span:first-child { color: var(--muted); }
.hline .num { font-weight: 700; white-space: nowrap; }
.hero .big + .hline { margin-top: 6px; }
.fold { margin-top: 10px; background: var(--surface); border-radius: 20px; }
.fold > summary { display: flex; align-items: center; gap: 10px; min-height: 54px; padding: 8px 14px 8px 16px; cursor: pointer; list-style: none; font-weight: 700; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary span:first-child { flex: 1; min-width: 0; }
.fold > summary .num { color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.fold > summary .ico { width: 18px; height: 18px; color: var(--muted); transition: transform .2s var(--ease); }
.fold[open] > summary .ico { transform: rotate(90deg); }
.fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 20px; }
.foldbody { padding: 0 14px 14px; }
.foldbody > .muted:first-child { margin-top: 0; font-size: 14px; }
.foldbody .rows { background: var(--tint); border-radius: 14px; }
.foldbody .notes { margin: 0; background: none; padding: 0 0 0 18px; }
.foldbody .actions { margin: 12px 0 0; }
.foldbody .chips { margin: 0 0 10px; }
.fold.inhero { margin: 14px -6px -8px; background: var(--tint); border-radius: 16px; }
.fold.inhero > summary { min-height: 46px; font-weight: 600; font-size: 15px; }
.fold.inhero .foldbody { margin: 0; }
.report, .invoice { padding-bottom: 8px; }
.footbtns.grow { flex: 1; }
.footbtns.grow .btn { flex: 1; }
.footbtns.grow .btn.primary { flex: 2; }
.invoice .row .side { font-size: 15px; }
.invoice .row .btn.small { padding: 6px; min-width: 36px; }
.cat.walk h2 span:first-child { font-size: 15px; color: var(--muted); }
@media print { .fold { background: none; break-inside: auto; } .fold > summary .ico { display: none; } .foldbody { padding: 0; } .hero { padding: 0; background: none; } }
.add.solo { margin-top: 12px; border: 0; border-radius: 14px; background: var(--tint); color: var(--text); font-weight: 600; }
#list { min-height: calc(100dvh - 250px); }
.foot .wrap > div:first-child { min-width: 0; }
.foot .small { overflow: hidden; text-overflow: ellipsis; }
.foot .total { font-size: 18px; }
.footbtns .btn { padding: 10px 12px; }
.footbtns .btn.primary { padding: 10px 12px 10px 16px; }
.foldbody table.summary { font-size: 13px; }
.foldbody .summary th, .foldbody .summary td { padding: 9px 2px; }
@media (max-width: 480px) { .foldbody .summary th:nth-child(3), .foldbody .summary td:nth-child(3) { display: none; } }

/* v3, fourth pass: write-offs, prices, glass, POS, catalogue, login */
.hero .newcount { margin: 16px 0 8px; }
.btn.wide2 { width: 100%; min-height: 46px; font-size: 14px; font-weight: 600; white-space: normal; text-align: center; }
.hero .btn.wide .ico { width: 18px; height: 18px; }
.note { font-size: 13px; margin: 16px 2px 0; }
.rows.tight .row { padding: 8px 8px 8px 14px; }
.rows.tight .row .btn.small, .rows .row > .btn.small.ghost { min-width: 34px; padding: 6px; border-color: transparent; color: var(--muted); }
.home > .chips { margin: 12px 0; }
.home > .fold:first-of-type { margin-top: 4px; }
.posacts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 10px; }
.posacts .btn { justify-content: center; text-align: center; min-height: 40px; }
.posacts .sugg { grid-column: 1 / -1; justify-content: flex-start; background: color-mix(in srgb, var(--ok) 16%, transparent); }
.posacts .sugg span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.posacts .sugg .ico { color: var(--ok); }
.posacts .btn:only-child { grid-column: 1 / -1; }
.doserow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.doserow .lbl { margin: 0; }
.doserow .field { width: 88px; flex: none; text-align: right; }
.foldbody .row.pick input { accent-color: var(--accent); }
.foldbody .actions.two { margin: 0 0 10px; }
.login { margin-top: 14vh; }
.login img { width: 120px; height: 120px; }
.login h1 { font-weight: 800; letter-spacing: -.03em; margin: 14px 0 22px; }
.login .field { text-align: center; min-height: 54px; font-size: 17px; }
.foot .small { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* users and permissions */
.login .field + .field { margin-top: 8px; }
.login .muted { margin: -8px 0 16px; font-size: 14px; }
.login .err { margin-top: 10px; }
button.userrow { width: 100%; text-align: left; font: inherit; color: inherit; border: 0; cursor: pointer; }
.check.perm { align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line); }
.check.perm:first-of-type { border-top: 0; }
.check.perm input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--accent); }
.check.perm .pname { display: block; font-weight: 600; }
.check.perm .phint { display: block; font-size: 13px; }
.role .actions { margin-top: 10px; }
dialog .fold { margin: 12px 0; }
dialog a.btn { display: flex; justify-content: center; text-decoration: none; }

/* The open list of a select: without this the browser draws it white with the page's light text. */
select option, select optgroup { background-color: var(--raised); color: var(--text); }
select option:checked { background-color: var(--accent); color: #1a1a1a; }
select option:disabled { color: var(--muted); }

/* delivery of an order, quick check */
.row.recv .parbox .qty { width: 64px; }
.row.recv { gap: 8px; }
.hero .lbl[for] { margin-top: 12px; }

/* closing the day */
.daynav { display: flex; gap: 8px; align-items: center; margin: 4px 0 2px; }
.daynav .field { flex: 1; min-width: 0; text-align: center; }
.daynav .btn { flex: none; padding: 0 12px; }
.dmoney { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0 6px; }
.dmoney .lbl { margin: 0 0 4px; }
.field.amt { text-align: right; font-variant-numeric: tabular-nums; }
.dline { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.dline [data-label] { flex: 1; min-width: 0; }
.dline .amt { flex: none; width: 96px; }
.dline .btn { flex: none; }
.dpost { padding: 8px 0 4px; border-top: 1px solid var(--line); }
.dpost:first-of-type { border-top: 0; }
.dpost .lbl { margin: 0 0 6px; font-weight: 600; color: var(--text); }
.day .add.solo { margin-top: 2px; }

.dstaff { display: grid; grid-template-columns: auto 1fr; gap: 8px 12px; align-items: center; }
.dstaff label { font-weight: 600; }
.hline.strong span:first-child { color: var(--text); font-weight: 600; }
.hline.strong .num { color: var(--accent-hi); font-weight: 800; font-size: 18px; }
.dcount { display: grid; grid-template-columns: auto 120px 1fr; gap: 10px; align-items: center; margin-top: 10px; }
.dcount .lbl { margin: 0; }
.dcount #d-diff { text-align: right; font-weight: 700; }

.dpost .chips { margin: 0 0 8px; }
.dpost .chip { min-height: 40px; }

/* the app's own message, question and input boxes */
dialog.ask { width: min(400px, calc(100vw - 32px)); }
dialog.ask p { margin: 0; font-size: 16px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
dialog.ask label { margin-top: 0; font-size: 15px; color: var(--text); }
dialog.ask .btns .btn { min-width: 96px; justify-content: center; }
/* staff of a post: a field and a button that turn a typed name into a chip */
.dpost .newname { display: flex; gap: 8px; }
.dpost .newname .field { flex: 1; min-width: 0; }
.dpost .chips:empty { display: none; }
.dpost .newname .btn { flex: none; width: 52px; padding: 0; justify-content: center; }
