:root {
  --bg: #FDFCFB;
  --ink: #1A1A1A;
  --muted: #7A7A72;
  --faint: #C8C6BF;
  --green: #2D5016;
  --green-soft: #E8F0DF;
  --line: #E8E6DF;
  --chip: #F5F3EE;
  --wa-text: #25D366;
  --wa-bg: #E8F5E3;
  --r-card: 16px;
  --r-tile: 12px;
}

* { box-sizing: border-box; }

/* `hidden` must win over component display rules (e.g. .login-step { display:flex }). */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Noto Sans Thai", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5; /* comfortable reading (matches sample); was browser "normal" (~1.2) */
}

::selection { background: var(--green-soft); }

.mono {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}

/* ---------- Page shell ---------- */
.app {
  max-width: 28rem;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 1.5rem 8rem;
  position: relative;
}

.center-card {
  max-width: 28rem;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}
.lang-screen { align-items: stretch; justify-content: flex-start; text-align: left; padding-top: 3.5rem; }
.lang-intro { margin-bottom: 2.5rem; }
.app-icon {
  display: inline-grid; place-items: center; width: 4.5rem; height: 4.5rem;
  border-radius: 1.25rem; background: #fff; border: 1px solid var(--line);
  box-shadow: 0 8px 20px -10px rgba(26, 26, 26, 0.25); margin-bottom: 2rem;
}
.app-icon img { width: 3.25rem; height: 3.25rem; }
.lang-intro .welcome-title { font-size: 2.5rem; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; margin: 0 0 0.75rem; color: var(--ink); }
.lang-intro .welcome-sub { font-size: 1.0625rem; color: var(--muted); margin: 0; }

/* ---------- Sticky header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 -1.5rem;
  padding: 1.25rem 1.5rem 1rem;
  background: rgba(253, 252, 251, 0.8);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto; /* always right-align, even when the back button is hidden */
}
.topbar-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}
.topbar-title h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.2;
}
.step-counter {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  white-space: nowrap;
}

.icon-btn {
  background: none;
  border: none;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0.25rem;
  border-radius: 999px;
}
.icon-btn:hover { color: var(--ink); }
.icon-btn svg { display: block; width: 1.5rem; height: 1.5rem; }
#back-btn { display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }
#back-btn[hidden] { display: inline-flex; visibility: hidden; }

.wa-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 15rem;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--wa-bg);
  color: var(--wa-text);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.wa-badge .wa-dot { flex-shrink: 0; }
.wa-dot {
  width: 0.375rem;
  height: 0.375rem;
  background: var(--wa-text);
  border-radius: 999px;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- Screen content ---------- */
#screen { padding-top: 1.5rem; }

.orders-toolbar { display: flex; justify-content: flex-end; margin: -0.75rem 0 0.5rem; }

h1 { font-size: 1.5rem; margin: 0.5rem 0; font-weight: 600; }
.muted { color: var(--muted); }
.empty-msg { padding: 0.5rem 0.25rem 1rem; font-size: 0.875rem; }

.section {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin: 1.5rem 0.25rem 0.75rem;
}

.intro { margin-bottom: 1.5rem; }
.intro h1 { font-weight: 300; letter-spacing: -0.01em; }
.intro h1 strong { font-weight: 600; }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
}
.pad { padding: 1.5rem; }
.big-emoji { font-size: 3rem; }

/* ---------- Selectable grids (lang / date / branch) ---------- */
.lang-grid, .date-grid, .branch-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
.date-grid { grid-template-columns: 1fr 1fr; }

.lang-btn, .date-card, .branch-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 1.5rem;
  font-size: 1rem;
  cursor: pointer;
  text-align: left;
  color: var(--ink);
  transition: border-color .15s, background .15s, box-shadow .15s, transform .1s;
  position: relative;
  overflow: hidden;
  width: 100%;
}
.lang-btn:hover, .date-card:hover, .branch-card:hover { border-color: var(--green); }
.lang-btn:active, .date-card:active, .branch-card:active { transform: scale(0.98); }

.date-card.selected, .branch-card.selected {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
  box-shadow: 0 10px 20px -8px rgba(45, 80, 22, 0.4);
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lang-btn > span:first-child { display: flex; flex-direction: column; }
.lang-btn .lang-label { font-weight: 500; font-size: 1.125rem; }
.lang-btn .lang-native { font-size: 0.875rem; color: var(--muted); }
.lang-btn .chev { color: var(--faint); font-size: 1.25rem; transition: color .15s; }
.lang-btn:hover .chev { color: var(--green); }

.date-card .wd { color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.25rem; }
.date-card .day { font-size: 1.75rem; font-weight: 600; line-height: 1; }
.date-card .mon { font-size: 0.875rem; color: var(--muted); margin-top: 0.25rem; }
.date-card.selected .wd { color: rgba(255,255,255,0.6); }
.date-card.selected .mon { color: rgba(255,255,255,0.8); }

.date-card .corner-badge {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.2rem 0.55rem;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  border-bottom-left-radius: 0.5rem;
  background: var(--green-soft);
  color: var(--green);
}
.date-card.selected .corner-badge { background: rgba(255,255,255,0.2); color: #fff; }

.branch-card .name { font-weight: 600; }
.branch-card .hint { color: var(--muted); font-size: 0.8125rem; margin-top: 0.25rem; }
.branch-card.selected .hint { color: rgba(255,255,255,0.8); }

/* ---------- Product rows ---------- */
#regs, #search-sec { display: block; }
.item-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 0.75rem 0.875rem;
  margin-bottom: 0.5rem;
  transition: border-color .15s, box-shadow .15s;
}
.item-wrap.active {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green);
}
.item { display: flex; align-items: center; gap: 0.75rem; }
.item .emoji {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: var(--chip);
  border-radius: var(--r-tile);
  font-size: 1.375rem;
}
.item .info { flex: 1; min-width: 0; }
.item .name {
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.3;
  overflow-wrap: anywhere; /* full name, no truncation — pack-size matters to the picker */
}
.item .hint { color: var(--muted); font-size: 0.75rem; line-height: 1.3; margin-top: 0.15rem; }
.star { color: var(--faint); font-size: 0.7rem; }

.remark {
  width: 100%;
  margin-top: 0.5rem;
  border: none;
  border-top: 1px solid var(--line);
  padding: 0.45rem 0.125rem 0;
  font-size: 0.8125rem;
  background: transparent;
  color: var(--ink);
  outline: none;
}
.remark::placeholder { color: var(--muted); }

/* ---------- Stepper ---------- */
.stepper { display: flex; align-items: center; gap: 0.375rem; flex-shrink: 0; }
.stepper button {
  width: 2.625rem;
  height: 2.625rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 1.375rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .15s, color .15s, transform .1s;
}
.stepper button:active { transform: scale(0.95); }
/* Hold-to-repeat: long-press must not trigger the iOS callout / text selection. */
.stepper button {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}
.stepper .minus { background: var(--chip); color: var(--muted); }
.stepper .minus:hover { background: var(--line); }
.stepper .plus { background: var(--green-soft); color: var(--green); }
.stepper .plus:hover { background: var(--green); color: #fff; }

.qty-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.stepper input.qty {
  width: 3.5rem;
  height: 2.5rem;
  text-align: center;
  border: 1px solid transparent;
  border-radius: var(--r-tile);
  background: var(--chip);
  color: var(--ink);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-weight: 700;
  font-size: 1rem;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: background .15s, border-color .15s, color .15s;
}
.stepper input.qty::-webkit-outer-spin-button,
.stepper input.qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper input.qty:focus { background: #fff; border-color: var(--green); color: var(--green); }
.item-wrap.active input.qty { background: #fff; border-color: var(--green); color: var(--green); }

/* Unit shown as a clear label under the qty (was a tiny corner sticker) — the
   picker must not confuse 2.5 KG with 2.5 PACK. */
.uom-badge {
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  line-height: 1;
}

/* ---------- Search ---------- */
.search-box {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color .15s;
  font-family: inherit;
}
.search-box:focus { border-color: var(--green); }
.search-box::placeholder { color: var(--muted); }

.same-btn {
  width: 100%;
  margin: 0.25rem 0 1rem;
  padding: 0.875rem;
  border: 1px dashed var(--faint);
  color: var(--muted);
  background: transparent;
  border-radius: var(--r-card);
  font-weight: 500;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  font-family: inherit;
}
.same-btn:hover { border-color: var(--green); color: var(--green); }

/* ---------- Sticky bottom bar ---------- */
.sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 1.5rem;
  max-width: 28rem;
  margin: 0 auto;
  background: linear-gradient(to top, var(--bg) 55%, rgba(253,252,251,0));
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
/* Scan + Preview live side by side so Scan never scrolls out of reach. */
.sticky-row { display: flex; gap: 0.625rem; align-items: stretch; }
.sticky-row .btn-primary { flex: 1; }
.scan-fab {
  flex-shrink: 0; width: 3.5rem; border: none; border-radius: var(--r-tile);
  background: var(--green-soft); color: var(--green); cursor: pointer;
  display: grid; place-items: center; font-family: inherit;
  transition: background .15s, color .15s, transform .1s;
}
.scan-fab:hover { background: var(--green); color: #fff; }
.scan-fab:active { transform: scale(0.96); }
.sticky:empty { display: none; }

.btn {
  width: 100%;
  padding: 1.25rem;
  border: none;
  border-radius: var(--r-card);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--green);
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 12px 24px -10px rgba(45, 80, 22, 0.5);
  transition: opacity .15s, transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.3; cursor: not-allowed; box-shadow: none; }
.btn.is-loading { opacity: 1; cursor: wait; }
.btn.is-loading .spinner {
  width: 1.15rem; height: 1.15rem;
  border-color: rgba(255, 255, 255, 0.4); border-top-color: #fff;
}

.btn-review { justify-content: space-between; }
.btn-review-left { display: flex; align-items: center; gap: 0.75rem; }
.btn-chevron { font-size: 1.1rem; }
.btn-count {
  background: rgba(255,255,255,0.2);
  padding: 0.125rem 0.6rem;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.btn-ghost {
  background: none;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.75rem;
  box-shadow: none;
}
.btn-ghost:hover { color: var(--ink); }

/* ---------- Summary ---------- */
.summary-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.summary-tile {
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  background: var(--green-soft);
  border-radius: var(--r-tile);
  display: grid;
  place-items: center;
  font-size: 1.25rem;
}
.summary-card .sum-label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 0.25rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}
.summary-card .sum-value { font-weight: 500; }

.items-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  overflow: hidden;
  margin-bottom: 1rem;
}
.items-card .items-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.items-card .items-head .section { margin: 0; }
.items-card .items-head .items-total {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}
.summary-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--line);
}
.summary-line:last-child { border-bottom: none; }
.summary-line .li-main { display: flex; align-items: center; gap: 1rem; min-width: 0; }
.summary-line .li-emoji { font-size: 1.25rem; flex-shrink: 0; }
.summary-line .li-name { font-weight: 500; font-size: 0.875rem; }
.summary-line .li-remark { color: var(--muted); font-size: 0.75rem; margin-top: 0.125rem; }
.summary-line .li-qty {
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  flex-shrink: 0;
}

.box {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.box.box-billed { background: var(--chip); }
.box .section { margin: 0 0 0.75rem; }
.box strong { font-size: 0.9375rem; }
.box .hint { color: var(--muted); font-size: 0.8125rem; margin-top: 0.25rem; }

/* ---------- Success screen ---------- */
.success {
  position: fixed;
  inset: 0;
  background: var(--green);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  z-index: 50;
}
.success-check {
  width: 6rem;
  height: 6rem;
  background: #fff;
  border: 4px solid rgba(255,255,255,0.2);
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 3rem;
  margin-bottom: 2rem;
}
.success h1 { font-size: 2rem; font-weight: 300; letter-spacing: -0.01em; margin-bottom: 1rem; }
.success-sub { color: rgba(255,255,255,0.6); margin-bottom: 2.5rem; max-width: 18rem; }
.success-ref {
  width: 100%;
  max-width: 22rem;
  padding: 1.5rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 1.5rem;
  margin-bottom: 2.5rem;
}
.success-ref .ref-label {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.5rem;
}
.success-ref .ref-id {
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.success-footer {
  color: rgba(255,255,255,0.4);
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  text-decoration: none;
}
.success-footer a { color: rgba(255,255,255,0.7); text-decoration: underline; text-underline-offset: 2px; }
.success-footer a:hover { color: #fff; }

/* Summary "Powered by FlowGo" footer (cream bg) */
.powered {
  text-align: center;
  margin-top: 0.5rem;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.powered a { color: var(--green); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- Seller logo ---------- */
.seller-logo {
  height: 4rem;
  width: auto;
  max-width: 70%;
  object-fit: contain;
  border-radius: 0.5rem;
  margin: 0.5rem 0 1.5rem;
  display: block;
}
.other-date {
  width: 100%;
  margin-top: 1rem;
  padding: 1.25rem;
  border: 1px dashed var(--faint);
  border-radius: var(--r-card);
  color: var(--muted);
  background: none;
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
}
.other-date:hover { border-color: var(--green); color: var(--green); }
.other-date.selected {
  background: var(--green); border-color: var(--green); color: #fff;
  box-shadow: 0 10px 20px -8px rgba(45, 80, 22, 0.4);
}
.other-date input[type="date"] {
  position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%;
  border: none; cursor: pointer;
}
.success-check img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 999px;
}

/* ---------- Animations ---------- */
@keyframes screenEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
.screen-enter { animation: screenEnter 0.28s cubic-bezier(0.22, 1, 0.36, 1); }

/* Rapid taps (e.g. +/- stepper) must not fire iOS Safari's double-tap smart
   zoom. Universal because a fat-finger second tap often lands on the card
   padding next to the button, and touch-action does not inherit. `manipulation`
   keeps pan + pinch-zoom; only double-tap-to-zoom is dropped. */
* {
  touch-action: manipulation;
}

/* Press feedback (active:scale like the reference) */
.btn, .same-btn, .other-date, .stepper button, .icon-btn, .lang-btn, .date-card, .branch-card {
  transition: transform 0.1s ease, border-color 0.15s, background 0.15s, box-shadow 0.15s, color 0.15s;
}
.btn:active:not([disabled]), .same-btn:active, .other-date:active,
.stepper button:active, .icon-btn:active { transform: scale(0.97); }

/* Success check pops in */
@keyframes pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.success-check { animation: pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* Greeting subtitle to text-sm (reference) */
.intro .muted { font-size: 0.875rem; }

/* Language screen logo (reference: h-16, mb-8, above Welcome, left-aligned) */
.lang-logo { margin: 0 0 2rem; align-self: flex-start; }

/* ---------- Custom calendar modal ---------- */
.cal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.cal-modal {
  background: #fff; border-radius: 1.5rem; padding: 1.5rem;
  width: 100%; max-width: 22rem;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.35);
  animation: popIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: none; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.cal-title { font-size: 1.125rem; font-weight: 600; }
.cal-x { background: none; border: none; font-size: 1.1rem; color: var(--muted); cursor: pointer; padding: 0.4rem; border-radius: 999px; line-height: 1; }
.cal-x:hover { background: var(--chip); color: var(--ink); }
.cal-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.cal-month { font-size: 1.125rem; font-weight: 700; }
.cal-arrows { display: flex; gap: 0.25rem; }
.cal-arrows button { background: none; border: none; color: var(--green); font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0.1rem 0.4rem; border-radius: 0.5rem; }
.cal-arrows button:hover { background: var(--green-soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0.15rem; }
.cal-wd { text-align: center; font-size: 0.8125rem; color: var(--muted); padding: 0.4rem 0; }
.cal-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border: none; background: none; font: inherit; font-size: 0.95rem; color: var(--ink); border-radius: 12px; cursor: pointer; }
.cal-cell.empty { cursor: default; }
.cal-cell.day:hover:not(.selected) { background: var(--green-soft); }
.cal-cell.disabled { color: var(--faint); cursor: not-allowed; }
.cal-cell.today { color: var(--green); font-weight: 700; }
.cal-cell.selected { background: var(--green); color: #fff; font-weight: 700; }
.other-date .cal-ico { margin-right: 0.25rem; }

/* ---------- Accessibility polish ---------- */
/* Unified keyboard focus ring (mouse clicks stay clean via :focus-visible). */
.lang-btn:focus-visible, .date-card:focus-visible, .branch-card:focus-visible,
.other-date:focus-visible, .btn:focus-visible, .btn-ghost:focus-visible,
.icon-btn:focus-visible, .same-btn:focus-visible, .stepper button:focus-visible,
.cal-cell.day:focus-visible, .cal-arrows button:focus-visible, .cal-x:focus-visible,
.lang-btn:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.search-box:focus-visible, .stepper input.qty:focus-visible, .remark:focus-visible {
  outline: 2px solid var(--green); outline-offset: 1px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Regulars loading (background fetch after branch switch) */
.regs-loading { display: flex; justify-content: center; padding: 2.5rem 0; }
/* Regulars fetch failed — retry affordance */
.regs-error { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding: 2rem 0; text-align: center; }
.btn-retry {
  padding: 0.6rem 1.5rem; border-radius: 999px; border: 1px solid var(--green);
  background: var(--green-soft); color: var(--green); font-weight: 600; cursor: pointer;
}
.spinner {
  width: 1.75rem; height: 1.75rem; border-radius: 999px;
  border: 2px solid var(--green-soft); border-top-color: var(--green);
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sticky search bar (stays pinned below topbar while items scroll) */
.search-bar {
  position: sticky;
  z-index: 9;
  background: var(--bg);
  padding: 0.75rem 0 0.5rem;
}


/* Success "Start New Order" button (on green bg) */
.success-btn {
  width: 100%;
  max-width: 22rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font: inherit;
  font-weight: 500;
  border-radius: var(--r-card);
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.success-btn:hover { background: rgba(255,255,255,0.18); }
.success-btn:active { transform: scale(0.98); }

/* "Select Other Date" as a grid card */
.other-card {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 0.35rem; color: var(--muted);
}
.other-card .oc-icon { font-size: 1.5rem; line-height: 1; }
.other-card .oc-label { font-size: 0.8125rem; font-weight: 600; line-height: 1.2; }
.other-card .oc-day { font-size: 1.75rem; font-weight: 600; line-height: 1; color: var(--ink); }
.other-card.selected, .other-card.selected .oc-day, .other-card.selected .mon { color: #fff; }

/* ---------- Placer name gate ---------- */
.name-input {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-top: 8px;
}
.link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--green);
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

/* ---------- picker additions (Task 8) ---------- */

/* Bare .card is used throughout the picker screens (order/item rows, preview
   lines) with no separate .pad modifier — give it its own padding so content
   doesn't sit flush against the border (base .card above is a plain container). */
.card { padding: 1rem 1.25rem; }

/* Not in the design spec's CSS block, but referenced by login.ts/no-access.ts/
   app.js — the picker's own primary/secondary/link button vocabulary
   (web-order's equivalent is the unrelated .btn class). */
.btn-primary, .btn-secondary, .btn-link { font-family: inherit; cursor: pointer; text-decoration: none; }
.btn-primary {
  width: 100%;
  padding: 1.25rem;
  border: none;
  border-radius: var(--r-card);
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--green);
  box-shadow: 0 6px 16px -8px rgba(45, 80, 22, 0.45);
  transition: filter .15s, box-shadow .15s, transform .1s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.btn-primary:hover { filter: brightness(1.08); box-shadow: 0 8px 20px -8px rgba(45, 80, 22, 0.5); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary[disabled] { opacity: 0.3; cursor: not-allowed; box-shadow: none; }
.btn-secondary {
  width: 100%;
  padding: 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
.btn-secondary:hover { border-color: var(--green); color: var(--green); }
.btn-secondary:active { transform: scale(0.98); }
.btn-link {
  background: none;
  border: none;
  padding: 0.5rem;
  color: var(--green);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-block;
}
.btn-link:hover { opacity: 0.8; }

/* App shell topbar user name (referenced by picker-app.ts, no rule shipped for it yet). */
.user-badge {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-card { cursor: pointer; }
.order-card.disabled { opacity: .55; cursor: default; }
.order-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* PO number subtitle under the items-screen title (referenced by app.js, no shipped rule). */
.order-sub { margin-bottom: 1rem; font-size: 0.8125rem; }
.badge { font-size: 12px; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-grey { background: var(--chip); color: var(--muted); }
.item-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 0.5rem; }
.item-row.changed { border-left: 4px solid #f59e0b; }
.item-row.zero { border-left: 4px solid #dc2626; }
.item-info { min-width: 0; }
.item-name { font-weight: 600; overflow-wrap: anywhere; }
/* Scoped under .stepper with two class selectors so this beats the pre-existing
   ".stepper button" web-order rule (0,1,1) which would otherwise win on specificity
   and shrink these to its 30px round +/- buttons. */
.stepper .step-btn {
  width: 44px; height: 44px; font-size: 22px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
.stepper .step-btn:hover { border-color: var(--green); color: var(--green); }
.stepper .step-btn:active { transform: scale(0.95); }
.qty-input {
  width: 64px; height: 44px; text-align: center; font-size: 18px;
  border: 1px solid var(--line); border-radius: 10px; font-family: inherit;
}
.qty-input:focus { outline: 2px solid var(--green); outline-offset: 1px; }

.offline-banner { background: #fef3c7; color: #92400e; text-align: center; padding: 0.5rem; font-size: 0.875rem; }
.done-box { text-align: center; padding: 3rem 1rem; }
.done-icon { font-size: 3.5rem; }

.login-main { padding: 2rem 1.25rem; display: flex; flex-direction: column; max-width: 24rem; margin: 0 auto; }
.login-logo { margin: 0 0 3rem 0; height: 3rem; width: auto; max-width: 12rem; align-self: flex-start; }
.login-title { font-size: 1.5rem; font-weight: 650; letter-spacing: -0.015em; line-height: 1.15; margin: 0 0 1.75rem; }
.login-step { display: flex; flex-direction: column; gap: 1rem; }
.login-sub { color: var(--muted); font-size: 0.9375rem; line-height: 1.45; margin: 0 0 0.25rem; }
.field { display: block; }
.field-label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--muted); margin-bottom: 0.5rem; }
.login-main input {
  width: 100%; box-sizing: border-box; height: 3.25rem; font-size: 1.0625rem;
  padding: 0 0.875rem; border: 1px solid var(--line); border-radius: 0.75rem;
  background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
.login-main input::placeholder { color: var(--muted); }
.login-main input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.otp-input {
  text-align: center; letter-spacing: 0.4em; padding-left: 0.4em;
  font-size: 1.5rem; font-weight: 700; height: 3.5rem;
}
/* "or" divider between the email path (primary) and Google (secondary). */
.or-divider { display: flex; align-items: center; gap: 0.75rem; color: var(--muted); font-size: 0.8125rem; margin: 0.125rem 0; }
.or-divider::before, .or-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn-google { gap: 0.625rem; }
.g-icon { flex-shrink: 0; }
.login-error {
  margin: 0.5rem 0 0; font-size: 0.875rem; color: #a3341f;
  background: #fbeae7; border-radius: 0.625rem; padding: 0.625rem 0.875rem;
}

.error-box, .error { color: #dc2626; text-align: center; font-size: 0.875rem; }
.error-box { padding: 1.5rem 0; }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }
/* .spinner and @keyframes spin already defined above (web-order "regulars loading"
   block) with the same shape this needs — reused as-is, not redeclared. */

/* ---------- team/company selection ---------- */
.sel-prompt { color: var(--muted); margin: 0 0 0.75rem; font-size: 0.9375rem; }
.sel-card { cursor: pointer; }
.sel-card strong { display: block; font-size: 1.0625rem; }
.sel-context { margin: 0 0 0.75rem; font-size: 0.8125rem; }

/* ---------- order search ---------- */
.search-input {
  width: 100%; height: 2.75rem; padding: 0 0.875rem; margin: 0 0 0.75rem;
  font-size: 1rem; border: 1px solid var(--border, #d1d5db); border-radius: 0.625rem;
  background: var(--card-bg, #fff); color: inherit; box-sizing: border-box;
}

/* ---------- login: fill exactly one viewport, no scroll ----------
   The shared .app rule adds an 8rem bottom pad (for the picking-flow sticky
   footer) and uses 100vh; on iOS Safari that overflows and the login scrolls.
   Login has no footer, so zero that pad, use dvh, and flex-center the content. */
.login-app {
  min-height: 100vh;  /* fallback for pre-dvh browsers (Chrome <108, old cheap Androids) */
  min-height: 100dvh;
  padding-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
}
.login-app .login-main { flex: 1; justify-content: center; }

/* ---------- order list ---------- */
.search-bar { display: flex; gap: 0.5rem; align-items: center; }
.search-bar .search-box { flex: 1; min-width: 0; }
.search-refresh { flex-shrink: 0; }
#orders-list { gap: 0.5rem; }
/* Row: debtor + meta on the left, total-qty chip (the picker's key number) on the right. */
.order-card {
  width: 100%; display: flex; align-items: center; gap: 0.875rem; text-align: left;
  padding: 0.8125rem 0.9375rem; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 0.875rem; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .08s;
}
.order-card:hover { border-color: var(--green); box-shadow: 0 4px 14px -10px rgba(45, 80, 22, 0.4); }
.order-card:active { transform: scale(0.99); }
.order-card.disabled { opacity: 0.62; cursor: default; }
.order-card.disabled:hover { border-color: var(--line); box-shadow: none; }
.order-card.disabled:active { transform: none; }
.order-main { flex: 1; min-width: 0; }
.order-name {
  font-weight: 700; font-size: 1.0625rem; line-height: 1.2; letter-spacing: -0.01em;
  color: var(--ink); overflow-wrap: anywhere;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem;
}
.order-meta { margin-top: 0.3125rem; font-size: 0.8125rem; color: var(--muted); }
.order-qty {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  min-width: 3.25rem; padding: 0.375rem 0.5rem; line-height: 1.05;
  background: var(--chip); border-radius: 0.625rem;
}
.qty-num { font-weight: 700; font-size: 1.0625rem; color: var(--ink); }
.qty-lbl { font-size: 0.5625rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; margin-top: 0.15rem; }
.item-wrap.zero { border-left: 3px solid #dc2626; }

/* Calendar grid: force 7 columns to shrink (aspect-ratio cells otherwise blow out 1fr). */
.cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-cell { min-width: 0; }

/* ---------- per-line "mark as picked" toggle ---------- */
.pick-check {
  flex-shrink: 0; width: 2.25rem; height: 2.25rem; border-radius: 50%;
  border: 2px solid var(--line); background: #fff; color: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.pick-check.on { background: var(--green); border-color: var(--green); color: #fff; }
.item .info { min-width: 0; }
.item-wrap.picked { border-color: var(--green); background: var(--green-soft); }

/* ---------- language-select brand logo ---------- */
.brand-logo { display: block; margin: 0 auto 0.75rem; width: auto; max-width: 160px; height: auto; }

/* ---------- preview / review summary ---------- */
.review-summary { padding: 1rem 1.125rem; border: 1px solid var(--line); border-radius: 0.875rem; background: #fff; margin-bottom: 1.25rem; }
.review-debtor { font-weight: 700; font-size: 1.0625rem; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: 0.625rem; }
.review-stats { display: flex; flex-wrap: wrap; gap: 0.375rem 1rem; }
.rv-stat { font-size: 0.8125rem; color: var(--muted); }
.rv-stat strong { color: var(--ink); font-weight: 700; }
.review-h { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); margin: 0 0 0.5rem; font-weight: 600; }
.review-line { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; padding: 0.625rem 0; border-bottom: 1px solid var(--line); }
.review-line:last-of-type { border-bottom: none; }
.rv-name { min-width: 0; overflow-wrap: anywhere; font-size: 0.9375rem; }
.rv-delta { flex-shrink: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.rv-delta strong { color: var(--ink); }
.review-nochange { margin: 0.25rem 0 0; }
.picked-by { margin-top: 1.5rem; font-size: 0.8125rem; }

/* ---------- item screen: PO + mark-all ---------- */
.items-head { display: flex; justify-content: space-between; align-items: center; gap: 0.75rem; margin-bottom: 0.875rem; }
.items-po { margin: 0; font-size: 0.8125rem; }
.mark-all {
  flex-shrink: 0; background: var(--green-soft); color: var(--green); border: none;
  border-radius: 0.5rem; padding: 0.45rem 0.8rem; font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: background .12s, transform .08s;
}
.mark-all:hover { background: #dbe8cd; }
.mark-all:active { transform: scale(0.97); }

/* ---------- barcode scan ---------- */
.items-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.scan-btn {
  display: inline-flex; align-items: center; gap: 0.35rem; background: var(--ink); color: #fff;
  border: none; border-radius: 0.5rem; padding: 0.45rem 0.75rem; font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: opacity .12s, transform .08s;
}
.scan-btn:hover { opacity: 0.9; }
.scan-btn:active { transform: scale(0.97); }

.scan-overlay {
  position: fixed; inset: 0; z-index: 100; background: #0b0b0c;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.scan-stage { position: relative; width: 100%; max-width: 30rem; aspect-ratio: 3 / 4; overflow: hidden; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-reticle {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 72%; height: 34%; border: 2px solid rgba(255,255,255,0.9); border-radius: 0.75rem;
  box-shadow: 0 0 0 100vmax rgba(0,0,0,0.45);
}
.scan-status {
  position: absolute; left: 0; right: 0; bottom: 2.5rem; text-align: center;
  color: #fff; font-size: 1rem; font-weight: 600; padding: 0 1.5rem; line-height: 1.35;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}
.scan-status.ok { color: #8fdc7a; }
.scan-status.warn { color: #ffc978; }
.scan-close {
  position: absolute; top: 1rem; right: 1rem; width: 2.75rem; height: 2.75rem; border-radius: 999px;
  background: rgba(255,255,255,0.15); color: #fff; border: none; font-size: 1.25rem; cursor: pointer;
  display: grid; place-items: center;
}

/* Match card — slides up over the camera on a scan hit. Picker confirms
   how many to grab (adjustable for short/out-of-stock), then scanning resumes. */
.scan-match {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  background: #fff; color: var(--ink);
  border-radius: 1rem 1rem 0 0; padding: 1.15rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0,0,0,0.35);
  animation: sm-up .18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes sm-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
.scan-match .sm-name { font-size: 1.0625rem; font-weight: 700; line-height: 1.3; }
.scan-match .sm-code { font-size: 0.8125rem; margin-top: 0.15rem; }
/* Weight decoded from a scale-printed label — the pack just scanned. */
.scan-match .sm-pack {
  display: inline-block; margin-top: 0.5rem; padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--green-soft); color: var(--green); font-weight: 700; font-size: 0.9375rem;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
}
.scan-match .sm-pick { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: 1rem; }
.scan-match .sm-label { font-size: 0.9375rem; font-weight: 600; }
.scan-match .sm-confirm {
  width: 100%; margin-top: 1.15rem; padding: 0.9rem; border-radius: 0.7rem; border: none;
  background: var(--green); color: #fff; font-size: 1rem; font-weight: 700; cursor: pointer; font-family: inherit;
}
.scan-match .sm-confirm:active { transform: scale(0.99); }
/* Print actions on the items screen — same pill vocabulary as .mark-all */
.print-btn {
  flex-shrink: 0; background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 0.5rem; padding: 0.45rem 0.7rem; font-size: 0.8125rem; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: border-color .15s, color .15s, transform .08s;
}
.print-btn:hover { border-color: var(--green); color: var(--green); }
.print-btn:active { transform: scale(0.97); }

/* ---- receiver ---- */

/* Shell header: logo + app name. Simpler than the picker's sticky .topbar —
   the receiver has no back/settings chrome, just one static header row. */
.app-head { display: flex; align-items: center; gap: 0.625rem; padding: 1.25rem 0 0.25rem; }
.app-head .head-logo { width: 2rem; height: 2rem; flex-shrink: 0; }
.app-head h1 { font-size: 1.25rem; font-weight: 600; margin: 0; }

/* PO-number / supplier-name search fields (same visual weight as login's
   .login-main input, scoped locally since the receiver shell has no
   .login-main ancestor). */
.rcv-field { margin-bottom: 1rem; }
.rcv-field label { display: block; font-size: 0.8125rem; font-weight: 500; color: var(--muted); margin-bottom: 0.5rem; }
.rcv-field input {
  width: 100%; box-sizing: border-box; height: 3.25rem; font-size: 1.0625rem;
  padding: 0 0.875rem; border: 1px solid var(--line); border-radius: 0.75rem;
  background: #fff; color: var(--ink); font-family: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.rcv-field input::placeholder { color: var(--muted); }
.rcv-field input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.rcv-loading { display: flex; justify-content: center; padding: 2rem 0; }
.rcv-results { margin-top: 1rem; }

/* Prior-GRN warning banner — amber, same palette as .offline-banner. */
.rcv-banner {
  background: #fef3c7; color: #92400e; border-radius: 0.75rem;
  padding: 0.75rem 1rem; font-size: 0.875rem; line-height: 1.4; margin-bottom: 1rem;
}

.rcv-po-head { margin-bottom: 0.25rem; }
.rcv-po-head .rcv-creditor { font-weight: 700; font-size: 1.0625rem; line-height: 1.2; letter-spacing: -0.01em; }
.rcv-po-head .rcv-meta { color: var(--muted); font-size: 0.8125rem; margin-top: 0.25rem; }

/* Receiving line rows: 44px tick target + 44px stepper buttons (brief's
   explicit touch-target size), disabled/greyed stepper until ticked. */
.rcv-line {
  background: #fff; border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 0.75rem 0.875rem; margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.75rem;
  transition: border-color .15s, background .15s;
}
.rcv-line.ticked { border-color: var(--green); background: var(--green-soft); }
.rcv-check {
  flex-shrink: 0; width: 2.75rem; height: 2.75rem; border-radius: 0.625rem;
  border: 2px solid var(--line); background: #fff; color: transparent;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.rcv-check.on { background: var(--green); border-color: var(--green); color: #fff; }
.rcv-line-info { flex: 1; min-width: 0; }
.rcv-line-name { font-weight: 600; font-size: 0.9375rem; line-height: 1.3; overflow-wrap: anywhere; }
.rcv-line-code, .rcv-line-ordered { font-size: 0.75rem; line-height: 1.3; margin-top: 0.15rem; }
.rcv-stepper { display: flex; align-items: center; gap: 0.375rem; flex-shrink: 0; }
.rcv-stepper button {
  width: 2.75rem; height: 2.75rem; border-radius: 0.625rem; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 1.25rem; line-height: 1; cursor: pointer;
  display: grid; place-items: center; font-family: inherit;
  transition: border-color .15s, color .15s, transform .1s, opacity .15s;
}
.rcv-stepper button:hover { border-color: var(--green); color: var(--green); }
.rcv-stepper button:active { transform: scale(0.95); }
.rcv-stepper button[disabled] { opacity: 0.35; cursor: not-allowed; transform: none; }
.rcv-stepper input.qty {
  width: 3.5rem; height: 2.75rem; text-align: center; font-size: 1rem;
  border: 1px solid var(--line); border-radius: 0.625rem; font-family: inherit;
  background: #fff; color: var(--ink);
}
.rcv-stepper input.qty:focus { outline: 2px solid var(--green); outline-offset: 1px; }
.rcv-stepper input.qty[disabled] { background: var(--chip); color: var(--muted); }

/* Scroll-into-view + flash on a scan match (closeScanner reveals the row
   again since the overlay is full-screen while scanning). */
@keyframes rcv-flash-kf { 0% { box-shadow: 0 0 0 3px var(--green); } 100% { box-shadow: 0 0 0 0 rgba(45, 80, 22, 0); } }
.rcv-flash { animation: rcv-flash-kf 1.1s ease-out; }

/* Photo thumbnail strip — horizontal scroll, same tile size for add + shots. */
.rcv-photo-strip {
  display: flex; gap: 0.625rem; overflow-x: auto; padding: 0.25rem 0.125rem 0.5rem;
  margin-bottom: 0.5rem; -webkit-overflow-scrolling: touch;
}
.rcv-thumb {
  position: relative; flex-shrink: 0; width: 5rem; height: 5rem;
  border-radius: 0.625rem; overflow: hidden; border: 1px solid var(--line); background: var(--chip);
}
.rcv-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rcv-thumb-remove {
  position: absolute; top: 0.25rem; right: 0.25rem; width: 1.5rem; height: 1.5rem;
  border-radius: 999px; border: none; background: rgba(0,0,0,0.55); color: #fff;
  font-size: 0.75rem; line-height: 1; cursor: pointer; display: grid; place-items: center;
}
.rcv-photo-add {
  flex-shrink: 0; width: 5rem; height: 5rem; border-radius: 0.625rem;
  border: 1px dashed var(--faint); background: transparent; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.25rem; font-size: 0.625rem; text-align: center; cursor: pointer; font-family: inherit;
  transition: border-color .15s, color .15s;
}
.rcv-photo-add:hover { border-color: var(--green); color: var(--green); }
.rcv-photo-plus { font-size: 1.25rem; line-height: 1; }
