.ab-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
  padding-bottom: calc(1rem + env(safe-area-inset-bottom));
}
@media (min-width: 640px) {
  .ab-overlay {
    align-items: center;
  }
}
.ab-sheet {
  width: min(100%, 28rem);
  max-height: min(88vh, 40rem);
  overflow: auto;
  background: #fff;
  border-radius: 1.25rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
  padding: 1.1rem 1.15rem 1.25rem;
}
.ab-sheet h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}
.ab-muted {
  color: #6b7280;
  font-size: 0.75rem;
}
.ab-close {
  border: 0;
  background: #f3f4f6;
  color: #111827;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}
.ab-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin: 1rem 0;
}
.ab-step {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: #9ca3af;
}
.ab-step span {
  display: block;
  height: 0.35rem;
  border-radius: 999px;
  background: #e5e7eb;
  margin-bottom: 0.35rem;
}
.ab-step.is-done span,
.ab-step.is-current span {
  background: var(--ab-brand);
}
.ab-step.is-current {
  color: var(--ab-brand);
}
.ab-step.is-done {
  color: #374151;
}
.ab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.9rem;
}
.ab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  border-radius: 0.75rem;
  padding: 0.45rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.ab-btn-primary {
  background: var(--ab-brand);
  color: #fff;
}
.ab-btn-ghost {
  background: #fff;
  color: var(--ab-brand);
  border: 1px solid rgba(26, 137, 72, 0.28);
}
.ab-stars {
  display: flex;
  gap: 0.35rem;
  margin: 0.85rem 0;
}
.ab-star {
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  background: transparent;
  color: #d1d5db;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
}
.ab-star.is-on {
  color: #f59e0b;
}
.ab-textarea {
  width: 100%;
  min-height: 5.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
  padding: 0.7rem 0.8rem;
  font: inherit;
  resize: vertical;
}
.ab-chat-fab,
.ab-call-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(5.2rem + env(safe-area-inset-bottom));
  z-index: 70;
  min-height: 2.75rem;
  border-radius: 999px;
  background: var(--ab-brand);
  color: #fff;
  border: 0;
  padding: 0.55rem 0.95rem;
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 0 8px 20px rgba(26, 137, 72, 0.28);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
}
.ab-call-fab:hover,
.ab-call-fab:focus-visible {
  background: #157a3e;
  color: #fff;
  outline: none;
}
.ab-rider-card {
  margin: 0.75rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 0.85rem;
  background: #f3faf6;
  border: 1px solid #d8eee1;
}
.ab-rider-card__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.ab-rider-card__avatar {
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #ecfdf3;
  color: var(--ab-brand);
  font-weight: 700;
  font-size: 1rem;
}
.ab-rider-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.ab-rider-card__label {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ab-brand);
}
.ab-rider-card__name {
  margin: 0.15rem 0 0;
  font-weight: 700;
  color: #111827;
}
.ab-rider-card__phone {
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: #374151;
}
.ab-call-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
}
.ab-call-btn svg {
  flex-shrink: 0;
}
/* Foodpanda-style floating order status pill (above bottom nav) */
.ab-order-pill {
  position: fixed;
  right: 0.85rem;
  bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  max-width: min(18.5rem, calc(100vw - 1.7rem));
  padding: 0.55rem 0.7rem;
  border: 0;
  border-radius: 1rem;
  background: #fff;
  color: #111827;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16), 0 0 0 1px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, bottom 0.2s ease;
}
.ab-order-pill:hover,
.ab-order-pill:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(26, 137, 72, 0.25);
  outline: none;
}
.ab-order-pill[hidden] {
  display: none !important;
}
.ab-order-pill.is-cartbar-up {
  bottom: calc(7.5rem + env(safe-area-inset-bottom, 0px));
}
.ab-order-pill__thumb {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.65rem;
  object-fit: cover;
  background: #ecfdf5;
  flex-shrink: 0;
}
.ab-order-pill__thumb.is-placeholder {
  display: grid;
  place-items: center;
  color: var(--ab-brand);
  font-size: 1rem;
}
.ab-order-pill__body {
  min-width: 0;
  flex: 1;
}
.ab-order-pill__meal {
  margin: 0;
  font-size: 0.65rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ab-order-pill__status {
  margin: 0.1rem 0 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: #14532d;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ab-order-pill__dots {
  display: flex;
  gap: 0.28rem;
  margin-top: 0.35rem;
}
.ab-order-pill__dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: #e5e7eb;
}
.ab-order-pill__dot.is-done,
.ab-order-pill__dot.is-current {
  background: var(--ab-brand);
}
.ab-order-pill__dot.is-current {
  box-shadow: 0 0 0 3px rgba(26, 137, 72, 0.2);
}
.ab-order-pill__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
  flex-shrink: 0;
}
.ab-order-pill__badge {
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.3rem;
  border-radius: 999px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
}
.ab-order-pill__chev {
  color: #9ca3af;
  font-size: 1.1rem;
  line-height: 1;
}
.ab-chat-drawer {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100%, 28rem);
  z-index: 75;
  background: #fff;
  border-radius: 1.1rem 1.1rem 0 0;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.12);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.ab-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #eef2f0;
  font-weight: 700;
}
.ab-chat-list {
  overflow: auto;
  padding: 0.75rem 0.9rem;
  min-height: 10rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.ab-bubble {
  max-width: 80%;
  border-radius: 0.9rem;
  padding: 0.5rem 0.7rem;
  font-size: 0.82rem;
  line-height: 1.4;
}
.ab-bubble-me {
  margin-left: auto;
  background: var(--ab-brand);
  color: #fff;
}
.ab-bubble-them {
  margin-right: auto;
  background: #f3f4f6;
  color: #111827;
}
.ab-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.9rem 0.4rem;
}
.ab-chip {
  border: 1px solid #d1d5db;
  background: #fff;
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font-size: 0.72rem;
  cursor: pointer;
}
.ab-chat-form {
  display: flex;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem calc(0.7rem + env(safe-area-inset-bottom));
}
.ab-chat-form input {
  flex: 1;
  min-height: 2.5rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.8rem;
  padding: 0 0.75rem;
  font: inherit;
}
.ab-feedback-btn {
  margin-top: 0.45rem;
  display: inline-flex;
}
.ab-card-clickable {
  cursor: pointer;
}
.ab-avatar-card {
  margin: 0.75rem auto 1rem;
  width: min(100%, 28rem);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
/* Customer profile upload card only on /profile/ — defense in depth */
body:not([data-ab-profile-home="1"]) #ab-avatar-card[data-ab-profile-upload] {
  display: none !important;
}
.ab-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}
.ab-avatar-img {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 999px;
  object-fit: cover;
  background: #ecfdf3;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--ab-brand);
  overflow: hidden;
}
.ab-avatar-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ab-cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
  margin: 0.6rem 0;
}
.ab-cal button {
  min-height: 2.1rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.ab-cal button.is-on {
  background: var(--ab-brand);
  color: #fff;
  border-color: var(--ab-brand);
}
.ab-cal button:disabled {
  opacity: 0.35;
  cursor: default;
}
.ab-select {
  width: 100%;
  min-height: 2.4rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.7rem;
  padding: 0 0.65rem;
  font: inherit;
  margin: 0.25rem 0 0.7rem;
}
.ab-sub-card {
  margin: 0.75rem auto 1rem;
  width: min(100%, 32rem);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1rem 1.05rem 1.1rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.ab-sub-card h3 {
  margin: 0;
  font-size: 1.02rem;
}
.ab-sub-banner {
  margin: 0.7rem 0;
  padding: 0.65rem 0.8rem;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  color: #9a3412;
  border-radius: 0.75rem;
  font-size: 0.82rem;
}
.ab-sub-banner-pending {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}
.ab-plan-pending-banner {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-radius: 0.9rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.ab-plan-pending-banner strong {
  display: block;
  margin: 0.35rem 0 0.25rem;
  color: #78350f;
  font-size: 0.95rem;
}
.ab-plan-pending-banner p {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
}
.ab-sub-balance {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.9rem;
  align-items: center;
  margin: 0.85rem 0 0.5rem;
}
.ab-sub-ring {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ab-brand) var(--ab-pct, 0%), #e5e7eb 0);
}
.ab-sub-ring span {
  width: 3.9rem;
  height: 3.9rem;
  border-radius: 999px;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #14532d;
  text-align: center;
  line-height: 1.15;
}
.ab-sub-stats {
  margin: 0;
  font-size: 0.86rem;
  color: #374151;
}
.ab-sub-stats strong {
  display: block;
  font-size: 1.05rem;
  color: #111827;
}
.ab-sub-week {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}
.ab-sub-day {
  border: 1px solid #e5e7eb;
  border-radius: 0.85rem;
  padding: 0.65rem 0.75rem;
  background: #fafafa;
}
.ab-sub-day header {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.ab-sub-slot {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: center;
  padding: 0.35rem 0;
  border-top: 1px solid #eef2f0;
  font-size: 0.8rem;
}
.ab-sub-slot:first-of-type {
  border-top: 0;
}
.ab-sub-slot button {
  min-height: 1.9rem;
  padding: 0 0.55rem;
  border-radius: 0.55rem;
  font-size: 0.72rem;
}
.ab-btn-warn {
  background: #fff;
  color: #b45309;
  border: 1px solid #fcd34d;
}
.ab-status-pill {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  text-transform: capitalize;
}
.ab-status-pill.is-confirmed { background: #dcfce7; color: #166534; }
.ab-status-pill.is-skipped { background: #fee2e2; color: #991b1b; }
.ab-status-pill.is-paused { background: #ffedd5; color: #9a3412; }
.ab-status-pill.is-unavailable { background: #f3f4f6; color: #6b7280; }
.ab-status-pill.is-pending_approval { background: #fef3c7; color: #92400e; }
.ab-plan-nav-note {
  display: block;
  font-size: 0.72rem;
  color: #6b7280;
  margin-top: 0.15rem;
}
.ab-mode-toggle {
  display: flex;
  gap: 0.35rem;
  margin: 0.65rem 0 0;
  padding: 0.22rem;
  border-radius: 999px;
  background: #f3f4f6;
  width: fit-content;
  max-width: 100%;
}
.ab-mode-toggle a,
.ab-mode-toggle button {
  border: 0;
  background: transparent;
  color: #6b7280;
  font: 650 0.75rem/1 system-ui, sans-serif;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  text-decoration: none;
}
.ab-mode-toggle .is-on {
  background: var(--ab-brand);
  color: #fff;
}
/* Plan/meal checkout: stack Confirm COD above bottom nav (do not hide nav) */
html.ab-checkout-page .ab-checkout-sticky-cta,
html.ab-checkout-page [data-ab-checkout-sticky="1"],
html.ab-checkout-page .fixed.bottom-0.border-t-2 {
  bottom: calc(4rem + env(safe-area-inset-bottom, 0px)) !important;
  z-index: 50 !important;
}
html.ab-checkout-page main {
  padding-bottom: calc(10rem + env(safe-area-inset-bottom, 0px)) !important;
}
.ab-rider-pack-root {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.9rem;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
}
.ab-rider-pack {
  background: #fff;
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.55rem;
  border: 1px solid #e5e7eb;
}
.ab-rider-pack h4 {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  color: #065f46;
}
.ab-rider-pack ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.ab-rider-pack li {
  padding: 0.3rem 0;
  border-bottom: 1px solid #f3f4f6;
  font-size: 0.82rem;
}
.ab-rider-pack li:last-child {
  border-bottom: 0;
}
