: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; }

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: 3rem; }
.lang-intro { margin-bottom: 2rem; }
.lang-intro h1 { font-size: 2.25rem; font-weight: 300; letter-spacing: -0.02em; margin-bottom: 0.5rem; }

/* ---------- 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;
}
.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;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.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: 1.875rem;
  height: 1.875rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 1.125rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .15s, color .15s, transform .1s;
}
.stepper button:active { transform: scale(0.95); }
.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 { position: relative; }
.stepper input.qty {
  width: 2.75rem;
  height: 2.125rem;
  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); }

.uom-badge {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  padding: 0.05rem 0.3rem;
  background: var(--line);
  color: var(--muted);
  border: 1px solid #fff;
  border-radius: 0.375rem;
  font-size: 0.5rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  z-index: 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;
}
.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); }

/* 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 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-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: 1.5rem 1rem; display: flex; flex-direction: column; gap: 1rem; max-width: 26rem; margin: 0 auto; }
.login-main label { display: block; font-size: 0.875rem; color: var(--muted); }
.login-main input {
  width: 100%; box-sizing: border-box; height: 3rem; font-size: 1.125rem;
  padding: 0 0.75rem; border: 1px solid var(--line); border-radius: var(--r-tile); margin-top: 0.375rem;
}

.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. */
