/* =====================================================================
   Page-level pieces: landing hero, shop cards, product cards,
   order cards, wallet, rider queue.
   ===================================================================== */

/* -------------------------------------------------------------- landing */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(760px 420px at 88% -12%, rgba(255, 255, 255, 0.2), transparent 62%),
    var(--brand-gradient);
  color: #fff;
  padding: 54px 0 62px;
}
@media (max-width: 560px) {
  .hero { padding: 32px 0 50px; }
  .hero-actions .btn { flex: 1 1 auto; justify-content: center; }
}
.hero::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 46px;
  background: var(--page);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  transform: scaleX(1.5);
}
.hero-inner { position: relative; z-index: 1; max-width: 660px; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.18);
  font-size: var(--t-xs);
  font-weight: 700;
  margin-bottom: 16px;
}
.hero h1 {
  color: #fff;
  font-size: clamp(1.8rem, 5.2vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}
.hero p {
  color: rgba(255, 255, 255, 0.88);
  font-size: var(--t-md);
  margin-top: 12px;
  max-width: 52ch;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.hero-facts {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  margin-top: 30px;
  position: relative;
  z-index: 1;
}
.hero-fact-value { font-size: var(--t-xl); font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.hero-fact-label { font-size: var(--t-xs); color: rgba(255, 255, 255, 0.76); font-weight: 600; }

.section { padding: 40px 0; }
.section-tight { padding: 26px 0; }
.section-alt { background: var(--surface); border-block: 1px solid var(--line); }

.step-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 18px;
  position: relative;
  transition: transform var(--med), box-shadow var(--med);
}
.step-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.step-num {
  position: absolute;
  top: 14px; right: 16px;
  font-size: var(--t-2xl);
  font-weight: 800;
  color: var(--surface-3);
  line-height: 1;
}
.step-ic {
  width: 44px; height: 44px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  color: var(--brand-strong);
  display: grid; place-items: center;
  margin-bottom: 13px;
}

.cat-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 15px 8px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: var(--t-xs);
  font-weight: 650;
  text-align: center;
  transition: all var(--med);
}
.cat-tile:hover {
  border-color: var(--brand-300);
  color: var(--brand-deep);
  transform: translateY(-2px);
  box-shadow: var(--sh-2);
}
.cat-emoji { font-size: 26px; line-height: 1; }

.role-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.role-card-top {
  padding: 18px;
  color: #fff;
  background: var(--brand-gradient);
}
.role-card.is-shop  .role-card-top { background: linear-gradient(135deg, var(--teal-500), var(--teal-700)); }
.role-card.is-rider .role-card-top { background: linear-gradient(135deg, var(--orange-400), var(--orange-600)); }
.role-card-top h3 { color: #fff; }
.role-card-top p { color: rgba(255, 255, 255, 0.85); font-size: var(--t-sm); margin-top: 3px; }
.role-card-body { padding: 18px; flex: 1 1 auto; }
.role-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.role-list li { display: flex; gap: 9px; align-items: flex-start; font-size: var(--t-sm); color: var(--ink-soft); }
.role-list .icon { color: var(--ok-500); margin-top: 2px; }

/* ----------------------------------------------------------- shop cards */

.shop-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  min-width: 0;
  width: 100%;
  transition: transform var(--med), box-shadow var(--med), border-color var(--med);
}
.shop-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--brand-300); }
.shop-card.is-far { opacity: 0.78; }
.shop-card.is-far:hover { transform: none; }
.shop-card-hit {
  position: absolute;
  inset: 0;
  z-index: 1;
}
.shop-card-hit:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }

.shop-card-media {
  position: relative;
  width: 100%;
  height: 132px;
  background:
    radial-gradient(120px 80px at 80% 20%, rgba(255, 255, 255, 0.55), transparent 70%),
    var(--brand-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.shop-card-media img { width: 100%; height: 100%; object-fit: cover; }
.shop-card-media .shop-emoji { font-size: 34px; line-height: 1; filter: drop-shadow(0 2px 0 rgba(255,255,255,0.4)); }

@media (min-width: 768px) {
  .shop-card-media { height: 140px; }
}

@media (max-width: 639px) {
  .shop-card-media { height: 96px; }
  .shop-card-media .shop-emoji { font-size: 28px; }
  .shop-card-logo { width: 32px; height: 32px; right: 8px; bottom: 8px; }
  .shop-card-body { padding: 8px 9px 9px; gap: 3px; }
  .shop-card-name { font-size: clamp(11px, 3.1vw, 13px); }
  .shop-card-meta,
  .shop-card-opens { font-size: clamp(9px, 2.6vw, 11px); }
  .shop-card-cta { font-size: clamp(9px, 2.6vw, 11px); }
  .shop-card-flags { top: 6px; left: 6px; max-width: calc(100% - 40px); }
  .shop-card-fav { width: 26px; height: 26px; top: 6px; right: 6px; }
  .shop-card-dist { font-size: clamp(8px, 2.3vw, 10px); bottom: 6px; left: 6px; }
  .shop-card-meta {
    overflow: hidden;
  }
  .shop-card-meta > span,
  .shop-card-meta .nowrap {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .shop-card-opens {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .shop-card-foot {
    flex-wrap: wrap;
    row-gap: 4px;
    gap: 5px;
  }
  .shop-card-cta {
    min-width: 0;
    margin-left: auto;
  }
  .shop-card-offers { overflow: hidden; }
  .shop-card-offers .offer-chip {
    font-size: clamp(8px, 2.3vw, 10px);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
@media (max-width: 380px) {
  .shop-card-cta-txt { display: none; }
}
.shop-card-media.has-photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(to top, rgba(10, 15, 22, 0.45), transparent);
  pointer-events: none;
}
.shop-card-logo {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  background: #fff;
  box-shadow: var(--sh-1);
}

.shop-card-flags {
  position: absolute;
  top: 8px; left: 8px;
  display: flex;
  gap: 5px;
  z-index: 2;
  flex-wrap: wrap;
  max-width: calc(100% - 52px);
  pointer-events: none;
}
.shop-card-flags .badge {
  font-size: 10px;
  padding: 2px 7px;
  gap: 3px;
}
.shop-card-fav {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 3;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  display: grid; place-items: center;
  color: var(--ink-faint);
  box-shadow: var(--sh-1);
  transition: all var(--fast);
}
.shop-card-fav:hover { transform: scale(1.08); }
.shop-card-fav.is-on { color: var(--bad-500); }
.shop-card-fav.is-on .icon { fill: currentColor; }

.shop-card-dist {
  position: absolute;
  bottom: 8px; left: 8px;
  z-index: 2;
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  background: rgba(10, 15, 22, 0.42);
  color: rgba(255, 255, 255, 0.95);
  font-size: 10px;
  font-weight: 650;
  backdrop-filter: blur(4px);
}
.shop-card-dist.is-far-dist {
  background: rgba(169, 100, 12, 0.82);
}

.shop-card-body {
  padding: 10px 12px 11px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}
.shop-card-name { font-size: var(--t-sm); font-weight: 750; letter-spacing: -0.015em; line-height: 1.25; }
.shop-card-meta {
  font-size: 11px;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  line-height: 1.25;
}
.shop-card-meta > span { min-width: 0; }
.shop-card-offers { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 1px; }
.shop-card-opens { margin-top: 1px; line-height: 1.25; }
.shop-card-foot {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}
.shop-card-foot .rating-pill {
  font-size: 10px;
  padding: 1px 6px;
}
.shop-card-cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 1px;
  font-size: 11px;
  font-weight: 750;
  color: var(--brand-strong);
  white-space: nowrap;
}
.shop-card:hover .shop-card-cta { color: var(--brand-deep); }

/* Shops list: 2-up on mobile, compact fixed width on tablet/desktop */
.shops-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) {
  .shops-grid {
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(240px, 280px));
  }
}

.cat-tile span:last-child {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.3em;
  line-height: 1.25;
}

/* Full-bleed shop header under the top bar */
body.page-store .app-main {
  padding-top: 0;
}
.store-page {
  padding-bottom: 72px;
}
@media (min-width: 860px) {
  .store-page { padding-bottom: 88px; }
}
.store-page-body {
  padding-top: 14px;
  padding-bottom: 8px;
}
.store-banner {
  position: relative;
  background:
    radial-gradient(420px 180px at 100% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    var(--brand-gradient);
  padding: 12px 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  transition: padding 0.28s ease, min-height 0.28s ease;
}
.store-head-sentinel {
  height: 1px;
  margin: 0;
  pointer-events: none;
}
.store-head-sticky {
  position: sticky;
  top: var(--header-h);
  z-index: 430;
}
.store-banner.has-photo > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.store-banner.has-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(7, 83, 61, 0.88), rgba(7, 83, 61, 0.55));
}
.store-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-width: 0;
  transition: gap 0.28s ease;
}
.store-head-main { flex: 1 1 180px; min-width: 0; }
.store-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.store-title-row h1 {
  margin: 0;
  color: #fff;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--t-lg);
  transition: font-size 0.28s ease;
}
.store-title-row .badge {
  overflow: hidden;
  max-width: 160px;
  opacity: 1;
  transition: max-width 0.28s ease, opacity 0.22s ease, padding 0.28s ease, margin 0.28s ease;
}
.store-sub {
  margin-top: 3px;
  font-size: var(--t-sm);
  color: rgba(255, 255, 255, 0.86);
  max-height: 2.8em;
  opacity: 1;
  overflow: hidden;
  transition: font-size 0.28s ease, max-height 0.28s ease, margin 0.28s ease;
}
.store-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.store-head-actions [data-fav].is-on {
  color: #fff;
}
.store-head-actions [data-fav].is-on .icon {
  fill: currentColor;
  stroke: currentColor;
}

.store-logo {
  width: 48px; height: 48px;
  border-radius: var(--r-md);
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: #fff;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 22px;
  flex: 0 0 auto;
  line-height: 1;
  transition: width 0.28s ease, height 0.28s ease, font-size 0.28s ease, border-radius 0.28s ease;
}
.store-head-actions .btn {
  transition: padding 0.28s ease, font-size 0.28s ease, gap 0.28s ease;
}
.store-head-sticky.is-compact .store-banner {
  padding: 10px 0;
  min-height: 64px;
}
.store-head-sticky.is-compact .store-head { gap: 12px; }
.store-head-sticky.is-compact .store-logo {
  width: 42px;
  height: 42px;
  font-size: 20px;
  border-radius: 11px;
}
.store-head-sticky.is-compact .store-title-row h1 { font-size: var(--t-sm); }
.store-head-sticky.is-compact .store-title-row .badge {
  max-width: 0;
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
  border-width: 0;
  pointer-events: none;
}
.store-head-sticky.is-compact .store-sub {
  font-size: 11px;
  max-height: 1.3em;
  margin-top: 1px;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.store-head-sticky.is-compact .store-head-actions .btn {
  padding: 6px 8px;
  font-size: 12px;
  gap: 4px;
}

.store-hero-body {
  padding: 8px 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  transition: padding 0.28s ease;
}
.store-meta-bar {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  transition: gap 0.28s ease;
}
.store-meta-row {
  display: flex;
  gap: 10px 14px;
  flex-wrap: wrap;
  align-items: center;
  font-size: var(--t-xs);
  color: var(--ink-soft);
  flex: 1 1 auto;
  min-width: 0;
  max-height: 96px;
  opacity: 1;
  overflow: hidden;
  transform: translateY(0);
  transition: max-height 0.28s ease, opacity 0.22s ease, margin 0.28s ease, transform 0.28s ease;
}
.store-meta-row > div {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.store-meta-row .offer-chip {
  flex: 0 0 auto;
}

@media (max-width: 640px) {
  .store-banner { padding: 10px 0; min-height: 64px; }
  .store-head { flex-wrap: nowrap; align-items: center; gap: 10px; }
  .store-head-main { flex: 1 1 auto; min-width: 0; }
  .store-head-actions { width: auto; flex: 0 0 auto; }
  .store-head-actions .btn { flex: 0 0 auto; padding: 6px 8px; }
  .store-action-label { display: none; }
  .store-logo { width: 42px; height: 42px; font-size: 20px; }
  .store-meta-bar { flex-wrap: wrap; }
  .store-head-sticky.is-compact .store-meta-row {
    max-height: 0;
    opacity: 0;
    margin: 0;
    transform: translateY(-6px);
    pointer-events: none;
  }
  .store-head-sticky.is-compact .store-search-form {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
  }
  .store-head-sticky.is-compact .store-meta-bar {
    gap: 0;
  }
  .store-head-sticky.is-compact .store-hero-body {
    padding: 6px 0;
  }
}

/* -------------------------------------------------------- product cards */

.product-list { display: flex; flex-direction: column; gap: 0; }
.product-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 13px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.product-row:last-child { border-bottom: 0; }
.product-thumb {
  width: 72px; height: 72px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  overflow: hidden;
  flex: 0 0 auto;
}
.product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-name { font-weight: 700; font-size: var(--t-base); }
.product-unit { font-size: var(--t-xs); color: var(--ink-muted); }
.product-price { display: flex; align-items: baseline; gap: 7px; margin-top: 3px; flex-wrap: wrap; }
.product-price .now { font-weight: 800; font-size: var(--t-base); }
.product-price .was { font-size: var(--t-xs); color: var(--ink-faint); text-decoration: line-through; }
.product-off {
  font-size: 10px;
  font-weight: 800;
  color: var(--ok-700);
  background: var(--ok-50);
  padding: 1px 6px;
  border-radius: 4px;
}
.product-action { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.product-row.is-out { opacity: 0.55; }

/* Storefront product grid */
.store-items-head { border-bottom: 0; }
.store-items {
  background: none;
  border: 0;
  box-shadow: none;
}
.store-items > [data-live-results] {
  padding: 4px 0 0;
}
.store-search-form {
  flex: 0 0 auto;
  width: min(320px, 100%);
  margin-left: auto;
  position: relative;
  z-index: 2;
  transition: width 0.28s ease, flex-basis 0.28s ease, margin 0.28s ease;
}
.store-search-form .input-group > .input,
.store-search-form .input-group > .btn {
  height: 32px;
  min-height: 32px;
  box-shadow: none;
}
.store-search-form .input-group > .input {
  font-size: 14px;
}
.store-search-form .input-group > .btn {
  background: transparent;
  color: var(--brand-strong);
}
@media (max-width: 640px) {
  .store-search-form {
    width: 100%;
    flex: 1 1 auto;
    margin-left: 0;
  }
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
@media (min-width: 720px) {
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
}
@media (min-width: 1100px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  min-width: 0;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.product-card:hover {
  border-color: var(--brand-300);
  box-shadow: var(--sh-1);
}
.product-card.is-out { opacity: 0.55; }
.product-card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--brand-soft);
  display: grid;
  place-items: center;
  overflow: hidden;
}
.product-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.product-card-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  color: var(--brand-deep);
  font-size: 15px;
  font-weight: 800;
  display: grid;
  place-items: center;
  letter-spacing: 0.02em;
}
.product-card-placeholder .icon {
  width: 22px;
  height: 22px;
  opacity: 0.7;
}
.product-card-off {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  background: var(--brand);
  padding: 2px 6px;
  border-radius: var(--r-pill);
}
.product-card-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 9px 10px;
  flex: 1 1 auto;
}
.product-card-body .product-name {
  font-size: var(--t-sm);
  line-height: 1.25;
  margin: 0;
}
.product-card-body .product-unit {
  line-height: 1.2;
  margin: 0;
  color: var(--ink-muted);
}
.product-card-body .product-price {
  margin-top: 3px;
  gap: 5px;
  line-height: 1.2;
}
.product-card-body .product-price .now { font-size: var(--t-sm); }
.product-card-body .product-price .was {
  color: var(--ink-muted);
  font-size: 11px;
}
.product-card-action {
  margin-top: auto;
  padding-top: 8px;
  display: flex;
  justify-content: center;
}
.product-card-action .btn {
  box-shadow: none;
  width: 148px;
  max-width: 100%;
  height: 34px;
  min-height: 34px;
  font-size: var(--t-xs);
  font-weight: 750;
  border-radius: var(--r-sm);
}
.product-card-action .btn-soft {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-color: transparent;
}
.product-card-action .btn-soft:hover {
  background: var(--brand-muted);
}
.product-card-action [data-product-control] {
  display: flex;
  width: 100%;
  justify-content: center;
}
.product-card-action [data-product-control] .btn,
.product-card-action [data-product-control] .stepper {
  width: 148px;
  max-width: 100%;
}
.product-card-action [data-product-control] .stepper {
  height: 34px;
  border: 0;
  background: var(--brand-soft);
  border-radius: var(--r-sm);
  justify-content: center;
  gap: 10px;
}
.product-card-action [data-product-control] .stepper button {
  width: 34px;
  flex: 0 0 34px;
  background: transparent;
  color: var(--brand-deep);
}
.product-card-action [data-product-control] .stepper button:hover {
  background: var(--brand-muted);
}
.product-card-action [data-product-control] .stepper .qty,
.product-card-action [data-product-control] .stepper-fill .qty {
  flex: 0 0 auto;
  min-width: 2.2em;
  height: 22px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--brand-deep);
  font-weight: 800;
  background: #fff;
  border-radius: 6px;
}

/* Product grid used in the shop owner catalogue */
.catalog-list { overflow: visible; }
.catalog-row {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto auto;
  gap: 10px 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.catalog-row:last-child { border-bottom: 0; }
.catalog-row:hover { background: var(--surface-2); }
.catalog-row.is-off { opacity: 0.6; }
.catalog-row .grow { min-width: 0; }
.catalog-row .product-thumb { width: 56px; height: 56px; }
.catalog-row .product-name,
.catalog-row .product-unit { overflow: hidden; text-overflow: ellipsis; }
.catalog-row .product-price { flex-wrap: wrap; margin-top: 2px; }
.catalog-tools { display: contents; }

.catalog-stock {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  min-width: 0;
}
.catalog-stepper {
  display: inline-flex;
  align-items: center;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  overflow: hidden;
}
.catalog-stock.is-low .catalog-stepper {
  border-color: var(--warn-500);
  background: var(--warn-50);
}
.catalog-stock.is-empty .catalog-stepper {
  border-color: var(--bad-300, var(--bad-500));
  background: var(--bad-50);
}
.catalog-stock.is-saving .catalog-stepper { opacity: 0.7; }
.catalog-stepper button {
  width: 32px;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: 0;
  padding: 0;
}
.catalog-stepper button:hover { background: var(--surface-3); color: var(--ink); }
.catalog-stock-qty {
  width: 46px;
  height: 100%;
  border: 0;
  padding: 0 2px;
  text-align: center;
  font-weight: 750;
  font-size: var(--t-sm);
  font-variant-numeric: tabular-nums;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  min-height: 0;
}
.catalog-stock-qty:focus { outline: none; box-shadow: none; }
.catalog-stock-unit {
  font-size: 11px;
  font-weight: 650;
  color: var(--ink-muted);
  white-space: nowrap;
  min-width: 3.2em;
}

.catalog-more { position: relative; }
.catalog-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 188px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-3);
  z-index: 30;
}
.catalog-row:last-child .catalog-menu,
.catalog-row:nth-last-child(2) .catalog-menu {
  top: auto;
  bottom: calc(100% + 4px);
}
.catalog-menu form { margin: 0; }
.catalog-menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-size: var(--t-sm);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}
.catalog-menu-item:hover { background: var(--surface-2); color: var(--ink); }
.catalog-menu-item.is-danger { color: var(--bad-700); }
.catalog-menu-item.is-danger:hover { background: var(--bad-50); }

@media (max-width: 900px) {
  .catalog-row {
    grid-template-columns: 56px minmax(0, 1fr) auto;
  }
  .catalog-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    grid-column: 2 / -1;
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .catalog-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    padding: 10px 12px;
  }
  .catalog-row .product-thumb { width: 48px; height: 48px; }
  .catalog-stock-qty { width: 40px; }
}

/* ---------------------------------------------------------- area groups */

.area-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 6px;
}
.area-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-soft);
  font-size: var(--t-xs);
  font-weight: 700;
}
.area-chip .count-bubble {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  font-size: 10px;
  background: var(--brand);
  color: #fff;
}
.area-chip.is-active {
  border-color: transparent;
  color: var(--ink);
  box-shadow: var(--sh-1);
}
.area-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 13px;
}
[data-orders-list] .area-heading { margin-top: 4px; }
[data-orders-list] .area-heading:first-child { margin-top: 0; }
.area-heading.is-phase {
  background: transparent;
  padding: 2px 4px 0;
  color: var(--ink-soft);
}
[data-orders-list] .area-heading.is-phase { margin-top: 8px; }
[data-orders-list] .area-heading.is-phase:first-child { margin-top: 0; }
[data-orders-list] .area-heading.is-phase + .area-heading { margin-top: 2px; }
.area-heading strong { font-weight: 800; }
.area-heading span { color: var(--ink-muted); font-size: 11px; font-weight: 700; }
.area-pill {
  display: inline-block;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.01em;
  vertical-align: 1px;
}
.area-tone-0, .is-tone-0 { background: #eef8f3; }
.area-tone-1, .is-tone-1 { background: #fff4ea; }
.area-tone-2, .is-tone-2 { background: #f3efff; }
.area-tone-3, .is-tone-3 { background: #eaf4ff; }
.area-tone-4, .is-tone-4 { background: #fff8e4; }
.area-tone-5, .is-tone-5 { background: #f2f4f3; }
.order-card.area-tone-0 { background: #f6fbf8; }
.order-card.area-tone-1 { background: #fffaf5; }
.order-card.area-tone-2 { background: #f8f6ff; }
.order-card.area-tone-3 { background: #f5f9ff; }
.order-card.area-tone-4 { background: #fffdf4; }
.order-card.area-tone-5 { background: #f7f8f7; }

/* ---------------------------------------------------------- order cards */

.order-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow var(--med), border-color var(--med);
}
.order-card:hover { box-shadow: var(--sh-2); }
.order-card.is-new { border-color: var(--orange-300); box-shadow: 0 0 0 3px rgba(244, 98, 31, 0.12); }
.order-card.is-live { border-color: var(--brand-300); }

.order-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.order-num { font-weight: 800; font-size: var(--t-base); letter-spacing: -0.01em; }
.order-when { font-size: var(--t-xs); color: var(--ink-muted); }
.order-head-right { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.order-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 13px; }

.order-party {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}

.order-items-mini { display: flex; flex-direction: column; gap: 6px; }
.order-item-mini {
  display: flex;
  gap: 10px;
  font-size: var(--t-sm);
  color: var(--ink-soft);
}
.order-item-mini .oi-name { flex: 1 1 auto; min-width: 0; }
.order-item-mini .oi-qty { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.order-item-mini .oi-amt { font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; }

.order-facts {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-size: var(--t-xs);
  color: var(--ink-muted);
}
.order-facts strong { color: var(--ink); font-weight: 700; }

.order-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.order-foot .grow { min-width: 120px; }
.order-hand-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex: 1 1 auto;
}
.order-hand-form .select {
  min-width: 140px;
  max-width: 220px;
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.pack-strip { cursor: pointer; }
.pack-strip a,
.pack-strip button,
.pack-strip select { cursor: pointer; }
.pack-strip-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "info side"
    "addr addr"
    "tags tags"
    "act act";
  align-items: start;
  column-gap: 16px;
  padding: 10px 14px 10px 18px;
}
.pack-strip-info {
  grid-area: info;
  min-width: 0;
}
.pack-strip-side {
  grid-area: side;
}
.pack-strip-addr {
  grid-area: addr;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
  white-space: normal;
}
.pack-strip-tags {
  grid-area: tags;
}
.pack-strip-top {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.pack-strip-top .pack-chip {
  flex: 0 0 auto;
}
.pack-strip-top .order-num {
  font-size: 14px;
  line-height: 1.2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pack-strip-top > .icon {
  flex: 0 0 auto;
  color: var(--ink-muted);
  transition: transform var(--med);
}
.pack-strip.is-open .pack-strip-top > .icon { transform: rotate(180deg); }
.pack-strip-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 6px;
}
.pack-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-soft);
  line-height: 1.2;
}
.pack-chip.badge-ok    { background: var(--ok-50);  color: var(--ok-700); }
.pack-chip.badge-bad   { background: var(--bad-50); color: var(--bad-700); }
.pack-chip.badge-info  { background: var(--info-50); color: var(--info-700); }
.pack-chip.badge-warn {
  background: var(--warn-50);
  color: var(--warn-700);
}
.pack-chip.pack-note-chip {
  background: #fffbee;
  color: var(--warn-700);
}
.pack-chip.pack-note-chip:hover,
.pack-strip.is-note-open .pack-chip.pack-note-chip {
  background: #fff6dc;
}
.pack-chip.is-count {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.cash-coming {
  margin: 0 0 12px;
  padding: 12px 14px 12px 16px;
  border-radius: var(--r-md);
  background: var(--warn-50);
  box-shadow: inset 4px 0 0 var(--warn-500);
}
.cash-coming-total {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--warn-700);
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.cash-coming-total span {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--warn-700);
}
.cash-coming-split {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 650;
  color: var(--warn-700);
}
.cash-coming.is-dash {
  margin: 0;
  padding: 10px 12px;
}
.cash-coming.is-dash .cash-coming-total { font-size: 20px; }
button.pack-chip {
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  gap: 4px;
}
.pack-strip-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
}
.pack-strip-side-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pack-strip-amt {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pack-strip-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pack-tool {
  width: 30px;
  padding: 0;
}
.pack-strip-act {
  grid-area: act;
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  margin-top: 8px;
}
.pack-strip-act:empty { display: none; }
.pack-strip-act .order-hand-form {
  flex: 0 1 auto;
  flex-wrap: nowrap;
  width: auto;
  gap: 6px;
}
.pack-strip-act .order-hand-form .select {
  height: 28px;
  min-height: 28px;
  min-width: 108px;
  max-width: 148px;
  width: 132px;
  padding: 0 26px 0 8px;
  font-size: 12px;
  line-height: 26px;
  background-position: right 8px center;
  text-overflow: ellipsis;
}
.pack-strip-drop {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--med);
}
.pack-strip.is-open .pack-strip-drop { grid-template-rows: 1fr; }
.pack-note-drop {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--med);
}
.pack-strip.is-note-open .pack-note-drop { grid-template-rows: 1fr; }
.pack-strip-drop-inner,
.pack-note-drop-inner {
  overflow: hidden;
  min-height: 0;
}
.pack-note-drop-inner p {
  margin: 0;
  padding: 8px 14px 8px 18px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--warn-700);
  background: #fffdf6;
  border-top: 1px solid #f4ead0;
}
.pack-strip-items {
  padding: 8px 14px 10px 18px;
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--med), transform var(--med);
}
.pack-strip.is-open .pack-strip-items {
  opacity: 1;
  transform: none;
}

@media (max-width: 860px) {
  .pack-strip-main {
    column-gap: 10px;
    padding: 10px 12px 10px 16px;
  }
  .pack-strip-amt { font-size: 14px; }
  .pack-strip-act .order-hand-form {
    flex-wrap: nowrap;
    width: auto;
    gap: 6px;
  }
  .pack-strip-act .order-hand-form .select {
    min-width: 0;
    width: 104px;
    max-width: 104px;
    min-height: 28px;
    height: 28px;
  }
}
@media (max-width: 720px) {
  .order-card .order-head { padding: 12px 14px; }
  .order-card .order-body { padding: 12px 14px; gap: 10px; }
  .order-card .order-foot { padding: 10px 14px; }
  .order-hand-form { width: 100%; }
  .order-hand-form .select { max-width: none; flex: 1 1 100%; }
  .pack-strip .order-hand-form {
    width: auto;
    flex-wrap: nowrap;
  }
  .pack-strip .order-hand-form .select {
    flex: 0 0 auto;
    width: 104px;
    max-width: 104px;
    min-width: 0;
    min-height: 28px;
    height: 28px;
  }
}

/* ---------------------------------------------------------- queue tabs */

.queue-tabs {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin-bottom: 8px;
  padding: 4px;
  background: var(--surface-3);
  border-radius: var(--r-md);
}
.queue-tab {
  flex: 1 1 0;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 10px;
  border-radius: var(--r-xs);
  color: var(--ink-muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}
.queue-tab.is-side { color: var(--ink-faint); font-weight: 650; }
.queue-tab-ic {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.queue-tab-ic svg { display: block; }
.queue-tab-label { line-height: 1; }
.queue-tab.is-active {
  background: var(--surface);
  color: var(--brand-strong);
  box-shadow: var(--sh-1);
}
.queue-tab-count {
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: var(--r-pill);
  display: inline-grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.queue-tab-count.is-hot {
  background: var(--bad-500);
  color: #fff;
}

@media (max-width: 860px) {
  .queue-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 580;
    margin: 0;
    flex-shrink: 0;
    min-height: calc(var(--queue-tabs-h) + env(safe-area-inset-bottom));
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(12px);
    border-radius: 0;
    border-top: 1px solid var(--line);
    gap: 0;
  }
  .queue-tab {
    flex: 1 1 0;
    flex-direction: column;
    flex-shrink: 0;
    gap: 3px;
    padding: 6px 2px 4px;
    font-size: clamp(9px, 2.4vw, 11px);
    border-radius: 10px;
  }
  .queue-tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
  }
  .queue-tab.is-active {
    background: var(--brand-soft);
    box-shadow: none;
  }
  .queue-tab.is-active::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 3px;
    border-radius: 0 0 99px 99px;
    background: var(--brand);
  }
  .queue-tab-count {
    position: absolute;
    top: 4px;
    right: calc(50% - 18px);
  }
  body.has-queue-tabs .panel-content {
    padding-top: 10px;
    padding-bottom: calc(var(--queue-tabs-h) + 24px + env(safe-area-inset-bottom));
  }
}

/* Delivery PIN callout */
.pin-card {
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--brand-soft);
  border: 1px dashed var(--brand-300);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* ---------------------------------------------------------- wallet card */

.wallet-hero {
  border-radius: var(--r-lg);
  padding: 20px;
  color: #fff;
  background: var(--brand-gradient);
  position: relative;
  overflow: hidden;
}
.wallet-hero.is-negative { background: linear-gradient(135deg, var(--bad-500), #7f1d1d); }
.wallet-hero::after {
  content: "";
  position: absolute;
  top: -40px; right: -30px;
  width: 170px; height: 170px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
.wallet-label {
  font-size: var(--t-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: rgba(255, 255, 255, 0.78);
}
.wallet-amount {
  font-size: var(--t-3xl);
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: #fff;
  font-variant-numeric: tabular-nums;
}
.wallet-note { font-size: var(--t-sm); color: rgba(255, 255, 255, 0.85); margin-top: 6px; }
.wallet-actions { display: flex; gap: 9px; margin-top: 16px; flex-wrap: wrap; position: relative; z-index: 1; }

.ledger-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-ic {
  width: 32px; height: 32px;
  border-radius: var(--r-xs);
  display: grid; place-items: center;
}
.ledger-ic.is-credit { background: var(--ok-50);  color: var(--ok-700); }
.ledger-ic.is-debit  { background: var(--bad-50); color: var(--bad-700); }
.ledger-amt { font-weight: 750; font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------------------------------------------------- rider queue */

.rider-hero {
  border-radius: var(--r-lg);
  padding: 18px;
  background: var(--brand-gradient);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.rider-hero .rider-hero-name { font-size: var(--t-lg); font-weight: 800; color: #fff; }
.rider-hero-stats {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}
.rider-hero-stat-value { font-size: var(--t-lg); font-weight: 800; color: #fff; }
.rider-hero-stat-label { font-size: 10.5px; color: rgba(255, 255, 255, 0.8); font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; }

.queue-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  background: var(--brand);
  color: #fff;
  font-size: var(--t-xs);
  font-weight: 800;
}

/* Shop dashboard — compact new-order list (no nested cards) */
.dash-order-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: -4px 0;
}
.dash-order-row {
  display: flex;
  gap: 10px;
  padding: 10px 2px 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.dash-order-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.dash-order-row:hover { background: var(--surface-2); }
.dash-order-main { flex: 1 1 auto; min-width: 0; }
.dash-order-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.dash-order-name {
  font-size: 13px;
  font-weight: 750;
  line-height: 1.25;
}
.dash-order-addr {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink-soft);
  line-height: 1.3;
}
.dash-order-count {
  margin-top: 2px;
  font-size: 11px;
  color: var(--ink-muted);
}
.dash-order-note {
  margin: 10px 0 0;
  font-size: 11px;
  color: var(--ink-soft);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.dash-order-sheet {
  font-size: 12px;
}
.dash-order-sheet .modal-head {
  padding: 18px 14px 12px 22px;
  align-items: flex-start;
}
.dash-order-sheet .modal-head h3 {
  font-size: 15px;
  font-weight: 750;
  line-height: 1.2;
}
.dash-order-sheet .modal-body { padding: 12px 14px 14px; }
.dash-order-sheet .modal-foot { padding: 10px 14px; }
.dash-sheet-who {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}
.dash-sheet-addr {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--ink-muted);
  line-height: 1.35;
  font-weight: 500;
}
.dash-sheet-phone {
  font-size: 12px;
  font-weight: 650;
  color: var(--brand-deep);
}
.dash-sheet-meta {
  margin: 3px 0 0;
  font-size: 11px;
  color: var(--ink-faint);
}
.dash-sheet-chip {
  flex: 0 0 auto;
  margin-top: 2px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  color: var(--ink-soft);
  white-space: nowrap;
}
.dash-sheet-table {
  width: calc(100% - 16px);
  border-collapse: collapse;
  margin-inline: 8px;
  font-size: 12px;
}
.dash-sheet-table th {
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  color: #111;
  background: var(--surface-3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 6px 6px;
}
.dash-sheet-table th:first-child { border-radius: 6px 0 0 6px; }
.dash-sheet-table th:last-child { border-radius: 0 6px 6px 0; }
.dash-sheet-table th.num,
.dash-sheet-table td.num { text-align: right; }
.dash-sheet-table td {
  padding: 6px 6px;
  border-top: 1px solid var(--line);
  vertical-align: middle;
  color: var(--brand-deep);
  font-weight: 650;
}
.dash-sheet-sn {
  width: 18px;
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
}
.dash-sheet-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dash-sheet-item img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--surface-3);
  flex: 0 0 auto;
}
.dash-sheet-rs {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.dash-sheet-bill {
  margin: 12px 8px 0;
  padding: 10px 4px 0;
  border-top: 1.5px dashed var(--line-strong);
}
.dash-order-sheet .bill { gap: 3px; }
.dash-order-sheet .bill-row,
.dash-order-sheet .bill-row.is-muted {
  font-size: 12px;
  font-weight: 400;
  color: var(--ink);
}
.dash-order-sheet .bill-row .bill-value,
.dash-order-sheet .bill-row.is-muted .bill-value {
  font-weight: 400;
  color: var(--ink);
}
.dash-order-sheet .bill-total {
  margin-top: 2px;
  padding-top: 8px;
  font-size: 13px;
  justify-content: flex-end;
  gap: 8px;
}
.dash-order-sheet .bill-total,
.dash-order-sheet .bill-total .bill-label,
.dash-order-sheet .bill-total .bill-value {
  font-weight: 800;
  color: var(--ink);
}
.dash-order-sheet .bill-total .bill-label { flex: 0 0 auto; }
.dash-order-sheet .bill-total .bill-value { font-size: 16px; }
.dash-order-sheet .modal-foot .btn { height: 40px; font-size: 13px; }
.dash-order-sheet .modal-foot form { flex: 1 1 auto; }
.dash-order-sheet .modal-foot form .btn { width: 100%; }
.dash-order-amount {
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.2;
}
.dash-order-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 8px;
  cursor: default;
}
.dash-order-pay {
  order: -1;
  margin-right: auto;
  font-size: 11px;
  color: var(--ink-muted);
  white-space: nowrap;
}

.duty-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.cash-shops-mini { display: grid; gap: 8px; }
.cash-shop-mini {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.cash-lines { display: grid; gap: 0; }
.cash-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.cash-lines .cash-line:first-child { border-top: 0; padding-top: 0; }
.cash-line-amt { white-space: nowrap; }
.cash-line.is-wait { opacity: 0.85; }
.cash-shop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
@media (prefers-reduced-motion: reduce) {
  #cashHandSheet.overlay.is-open,
  #cashHandSheet .modal {
    animation: none;
  }
}

/* ---------------------------------------------------- QR scanner sheet */

#qr-reader { border-radius: var(--r-md); overflow: hidden; }
#qr-reader video { width: 100% !important; border-radius: var(--r-md); }
.qr-guide {
  position: relative;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--slate-900);
  min-height: 250px;
  display: grid;
  place-items: center;
}
.qr-scanline {
  position: absolute;
  left: 8%; right: 8%;
  height: 2px;
  background: var(--brand-300);
  box-shadow: 0 0 12px var(--brand);
  animation: scanline 2s ease-in-out infinite alternate;
}
@keyframes scanline { from { top: 16%; } to { bottom: 16%; top: auto; } }

.cart-split {
  grid-template-columns: minmax(0, 1fr) 320px;
  justify-content: center;
}
@media (max-width: 1000px) {
  .cart-split { grid-template-columns: 1fr; }
}

.cart-page {
  max-width: 960px;
  margin-inline: auto;
  font-size: 13px;
}
.cart-page .section-head h1 {
  margin: 0;
  font-size: 18px;
}
.cart-page .section-head .muted,
.cart-page .muted,
.cart-page .alert-body,
.cart-page .product-unit,
.cart-page .product-price .btn {
  font-size: 12px;
}
.cart-page .card-head {
  padding: 12px 14px;
}
.cart-page .card-head h3,
.cart-page .card-pad > h4 {
  font-size: 13px;
  font-weight: 750;
}
.cart-page .card-body { padding: 12px 14px; }
.cart-page .card-foot { padding: 10px 14px; }
.cart-page .card-pad { padding: 14px; }
.cart-page .product-row { padding: 10px 0; gap: 10px; }
.cart-page .product-thumb { width: 56px; height: 56px; }
.cart-page .product-name { font-size: 13px; font-weight: 700; }
.cart-page .product-price { margin-top: 2px; }
.cart-page .product-price .now { font-size: 13px; }
.cart-page .bill-row { font-size: 12px; }
.cart-page .bill-total { font-size: 14px; }
.cart-page .bill-total .bill-value { font-size: 18px; }
.cart-page .btn-lg {
  font-size: 15px;
  font-weight: 750;
}

/* ----------------------------------------------------------- checkout */

.checkout-page {
  max-width: 560px;
  margin-inline: auto;
  font-size: 13px;
}
.checkout-page .section-head h1 {
  margin: 0;
  font-size: 18px;
}
.checkout-page .section-head .muted,
.checkout-page .muted,
.checkout-page .alert-sm,
.checkout-page .alert-body {
  font-size: 12px;
}
.checkout-page .card-head {
  padding: 12px 14px;
}
.checkout-page .card-head h3 {
  font-size: 13px;
  font-weight: 750;
}
.checkout-page .card-body { padding: 12px 14px; }
.checkout-page .label {
  font-size: 11px;
}
.checkout-page .select,
.checkout-page .textarea {
  min-height: 36px;
  font-size: 13px;
}
.checkout-page .textarea { min-height: 64px; }
.checkout-addr-detail {
  margin: 0;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.4;
}
.checkout-page .order-item-mini {
  font-size: 12px;
}
.checkout-page .bill-row {
  font-size: 12px;
}
.checkout-page .bill-total {
  font-size: 14px;
}
.checkout-page .bill-total .bill-value {
  font-size: 18px;
}
.checkout-pay-actions .btn {
  justify-content: flex-start;
  gap: 12px;
  height: auto;
  min-height: 50px;
  padding: 10px 14px;
  white-space: normal;
  text-align: left;
  font-size: 15px;
  font-weight: 750;
}
.checkout-pay-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.2;
}
.checkout-pay-sub {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.75;
}
.checkout-pay-amt {
  margin-left: auto;
  font-weight: 800;
  flex: 0 0 auto;
  font-size: 16px;
}

/* ---------------------------------------------------------- addresses */

.addresses-page .section-head h1 {
  margin: 0;
  font-size: var(--t-lg);
}
.addresses-page .section-head .muted,
.addresses-page .muted,
.addresses-page .t-xs {
  font-size: 12px;
}
.addresses-page .w-700 {
  font-size: 14px;
}
.addresses-page .t-sm,
.addresses-page .label,
.addresses-page .input,
.addresses-page .select,
.addresses-page .textarea {
  font-size: 13px;
}
.addresses-page .empty h3 {
  font-size: 15px;
}
.addresses-page .empty p {
  font-size: 13px;
}
.address-card {
  position: relative;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: 10px;
  will-change: transform;
}
.address-card.is-pickable {
  cursor: pointer;
}
.address-card.is-pickable:hover {
  border-color: var(--line-strong);
}
[data-address-list].is-busy {
  pointer-events: none;
}
.address-card-flag { display: none !important; }
.address-card.is-current .address-card-flag { display: inline-flex !important; }
button.address-card-use {
  font-size: 10px;
  padding: 2px 8px;
  line-height: 1.3;
}
.address-card-top {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.address-card-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.address-card-line {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--ink-soft);
  line-height: 1.35;
}
.address-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
}
.address-card-actions .btn {
  border: 1px solid var(--line);
  background: var(--surface);
}
.address-card-actions .btn:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}
.address-card-remove { color: var(--bad-500); }
.address-card-remove:hover { color: var(--bad-700); }

/* ----------------------------------------------------------- account */

.account-page {
  font-size: 13px;
}
.account-profile {
  padding: 12px 14px;
}
.account-profile h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.2;
}
.account-profile .muted,
.account-page .muted {
  margin: 2px 0 0;
  font-size: 12px;
}
.account-profile .btn-icon {
  border: 1px solid var(--line);
  background: var(--surface);
}
.account-running {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 700;
}
.account-running:hover { color: var(--brand-deep); }
.account-running .icon:last-child { margin-left: auto; }
.account-menu {
  margin-top: 12px;
  overflow: hidden;
}
.account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  color: inherit;
  border-bottom: 1px solid var(--line);
}
.account-row:last-child { border-bottom: 0; }
.account-row:hover { background: var(--surface-2); color: inherit; }
.account-row-ic {
  width: 32px;
  height: 32px;
  border-radius: var(--r-xs);
  display: grid;
  place-items: center;
  background: var(--surface-3);
  color: var(--ink-soft);
  flex: 0 0 auto;
}
.account-row-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}
.account-row-sub {
  display: block;
  font-size: 12px;
  color: var(--ink-muted);
  line-height: 1.3;
}
.account-partners {
  margin: 14px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
}
.account-partners a { color: var(--ink-muted); }
.account-partners a:hover { color: var(--brand-deep); }
.account-meta { margin-top: 8px; }

/* -------------------------------------------------------- order receipt */

.receipt-page {
  max-width: 420px;
  margin: 24px auto 40px;
  padding: 0 16px;
}
.receipt-actions {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}
.order-receipt {
  background: #fff;
  color: #111;
  border: 1px solid var(--line);
  padding: 22px 20px 18px;
  font-size: 13px;
  line-height: 1.4;
}
.receipt-brand,
.receipt-shop,
.receipt-foot { text-align: center; }
.receipt-app {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.receipt-web {
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
  color: #111;
}
.receipt-tag,
.receipt-shop-addr,
.receipt-label {
  font-size: 11px;
  color: var(--ink-muted);
}
.receipt-shop { margin: 2px 0; }
.receipt-shop-name { font-size: 15px; font-weight: 750; }
.receipt-rule {
  border-top: 1px dashed #bbb;
  margin: 12px 0;
}
.receipt-kv > div,
.receipt-bill .bill-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  font-size: 12px;
  font-weight: 400;
  color: #111;
}
.receipt-kv span { color: var(--ink-muted); }
.receipt-to { font-size: 12px; }
.receipt-who { font-weight: 750; font-size: 14px; }
.receipt-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.receipt-items th {
  text-align: left;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0 0 6px;
  color: #111;
}
.receipt-items td { padding: 5px 0; border-top: 1px solid #eee; }
.receipt-items .num,
.receipt-items th.num { text-align: right; }
.receipt-bill .bill { gap: 2px; }
.receipt-bill .bill-row .bill-value { font-weight: 400; color: #111; }
.receipt-bill .bill-items .bill-label,
.receipt-bill .bill-items .bill-value {
  font-weight: 800;
  color: #111;
}
.receipt-bill .bill-total {
  justify-content: flex-end;
  gap: 10px;
  font-weight: 800;
  padding-top: 8px;
}
.receipt-bill .bill-total .bill-label { flex: 0 0 auto; }
.receipt-bill .bill-total .bill-value {
  font-size: 16px;
  font-weight: 800;
  color: #111;
}
.receipt-foot {
  margin: 0;
  font-size: 12px;
  font-weight: 650;
}

/* --------------------------------------------------------- print styles */

@media print {
  @page { margin: 12mm; size: auto; }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .topbar, .tabbar, .queue-tabs, .panel-side, .panel-top, .site-foot,
  .btn, .toast-host, .announce, .shop-wait-bar, .cart-fab, .skip-link,
  .receipt-actions { display: none !important; }
  body { background: #fff; }
  .card, .qr-frame { box-shadow: none; border-color: #ccc; }
  .panel { grid-template-columns: 1fr; }
  .panel-content { padding: 0; }
  .receipt-page {
    max-width: 420px;
    margin: 0 auto;
    padding: 0;
  }
  .order-receipt {
    border: 0;
    padding: 22px 20px 18px;
  }
  .receipt-items tr,
  .receipt-bill .bill-row,
  .receipt-kv > div,
  .receipt-to {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

.interest-stats { max-width: 360px; }
.interest-list { list-style: none; margin: 0; padding: 0; }
.interest-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.interest-row:last-child { border-bottom: 0; }
.interest-add {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.interest-add-qty {
  width: 64px;
  min-height: 34px;
  padding: 4px 8px;
  text-align: center;
}
.interest-add.is-saving { opacity: 0.6; pointer-events: none; }
@media (max-width: 860px) {
  .interest-grid { grid-template-columns: 1fr; }
  .interest-refill { flex-wrap: wrap; }
  .interest-add { width: 100%; justify-content: flex-end; }
}

/* ------------------------------------------------ rider job + live track */

.ride-now {
  padding: 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--brand-300);
  box-shadow: 0 0 0 3px var(--brand-soft);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ride-now-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-strong);
}
.ride-now-title {
  font-size: var(--t-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.ride-now-addr {
  margin: 0;
  font-size: var(--t-sm);
  color: var(--ink-soft);
  line-height: 1.4;
}

.ride-next {
  padding: 10px 12px;
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  border: 1px solid var(--brand-300);
}
.ride-next-kicker {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--brand-strong);
}
.ride-next-title { font-weight: 800; font-size: var(--t-sm); margin-top: 2px; }
.ride-next-sub { font-size: var(--t-xs); color: var(--ink-soft); margin-top: 2px; }

.order-party.is-now,
.route-stop.is-now {
  background: var(--brand-soft);
  box-shadow: inset 3px 0 0 var(--brand);
}
.route-stop {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 11px 12px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.route-stop.is-done { opacity: 0.72; }
.route-stop-num {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  background: var(--ink);
  color: #fff;
}
.route-stop.is-now .route-stop-num { background: var(--brand); }
.route-stop.is-done .route-stop-num { background: var(--brand-300); color: var(--brand-deep); }

.track-map {
  height: 210px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  isolation: isolate;
  z-index: 0;
}
.track-map .leaflet-control-attribution {
  font-size: 10px;
}
.track-pin { background: none; border: 0; }
.track-pin span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}
.track-pin-home span { background: var(--brand); }
.track-pin-rider span { background: var(--slate-800); }

.track-overlay {
  padding: 0;
  align-items: stretch;
  justify-content: stretch;
  background: rgba(10, 15, 22, 0.35);
  z-index: 850;
  overflow: hidden;
}
@media (max-width: 640px) {
  .track-overlay { align-items: stretch; padding: 0; }
}
.track-overlay.is-open { display: flex; }
.track-sheet {
  width: 100%;
  height: 100%;
  max-height: 100%;
  display: grid;
  grid-template-rows: 54% 46%;
  background: var(--surface);
  animation: slide-up var(--slow) both;
  overflow: hidden;
  transition: grid-template-rows var(--slow);
}
.track-overlay.is-full .track-sheet {
  grid-template-rows: calc(100% - 148px) 148px;
}
.track-sheet-map-wrap {
  position: relative;
  min-height: 0;
  background: var(--surface-2);
  overflow: hidden;
}
.track-sheet-map {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  isolation: isolate;
  z-index: 0;
}
.track-sheet-tools {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  right: 12px;
  z-index: 500;
  display: flex;
  gap: 8px;
}
.track-sheet-tools .btn {
  background: var(--surface);
  box-shadow: var(--sh-2);
}
.track-sheet-chip {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 500;
  padding: 8px 12px;
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--sh-2);
  font-size: var(--t-sm);
  font-weight: 750;
  text-align: center;
}
.track-sheet-detail {
  min-height: 0;
  overflow-y: auto;
  padding: 6px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.track-sheet-grab {
  width: 38px;
  height: 4px;
  border-radius: var(--r-pill);
  background: var(--line-strong);
  margin: 4px auto 10px;
}
.track-sheet-detail .pin-card { margin-top: 10px; }
.track-overlay.is-full .track-sheet-detail .row.row-wrap { margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .track-sheet,
  .track-sheet-map-wrap,
  .track-sheet-detail {
    animation: none;
    transition: none;
  }
}
