/* Elektrobee Vending — design tokens & base styles */

:root {
  /* Brand — current values, swapped by applyBrand() in brands.js */
  --eb-navy: #042147;
  --eb-navy-rgb: 4, 33, 71;
  --eb-navy-900: var(--eb-navy);
  --eb-navy-700: #0a3a7e;
  --eb-navy-700-rgb: 10, 58, 126;
  --eb-navy-500: #1a5fb4;
  --eb-amber: #F2B544;
  --eb-amber-rgb: 242, 181, 68;
  --eb-amber-strong: #E29A1B;
  --eb-amber-strong-rgb: 226, 154, 27;
  --eb-amber-soft: #FDF1D6;

  /* Surfaces */
  --eb-bg: #F4F6F9;
  --eb-bg-elev: #FFFFFF;
  --eb-bg-muted: #ECEFF4;
  --eb-overlay: rgba(var(--eb-navy-rgb), 0.55);

  /* Text */
  --eb-ink: #0F1729;
  --eb-ink-2: #2C3447;
  --eb-muted: #5B6478;
  --eb-faint: #8E97A9;
  --eb-line: #E5E8EE;
  --eb-line-soft: #EFF1F5;

  /* Semantic */
  --eb-success: #1F8A5B;
  --eb-success-soft: #E5F4ED;
  --eb-danger: #D9483F;
  --eb-danger-soft: #FBE9E7;
  --eb-warn: #E89923;
  --eb-warn-soft: #FDF1DC;
  --eb-info: #2C6FE0;

  /* Type */
  --eb-font: 'Inter', -apple-system, system-ui, sans-serif;
  --eb-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;

  /* Spacing */
  --eb-r-sm: 8px;
  --eb-r-md: 12px;
  --eb-r-lg: 16px;
  --eb-r-xl: 22px;

  /* Shadows */
  --eb-shadow-sm: 0 1px 2px rgba(var(--eb-navy-rgb), 0.04), 0 1px 1px rgba(var(--eb-navy-rgb), 0.03);
  --eb-shadow-md: 0 4px 12px rgba(var(--eb-navy-rgb), 0.06), 0 2px 4px rgba(var(--eb-navy-rgb), 0.04);
  --eb-shadow-lg: 0 12px 32px rgba(var(--eb-navy-rgb), 0.10), 0 4px 12px rgba(var(--eb-navy-rgb), 0.06);
  --eb-glow-amber: 0 0 0 4px rgba(var(--eb-amber-rgb), 0.18), 0 6px 18px rgba(var(--eb-amber-strong-rgb), 0.25);
}

/* dark accents kept subtle since the consumer app is light by default */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--eb-font);
  color: var(--eb-ink);
  background: #1c2030;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Brand-aware shadow helpers — derived from amber/navy CSS-var triplets so
   they recolor with the brand instead of staying Elektrobee blue. */
:root {
  --eb-overlay: rgba(var(--eb-navy-rgb), 0.55);
  --eb-shadow-sm: 0 1px 2px rgba(var(--eb-navy-rgb), 0.04), 0 1px 1px rgba(var(--eb-navy-rgb), 0.03);
  --eb-shadow-md: 0 4px 12px rgba(var(--eb-navy-rgb), 0.06), 0 2px 4px rgba(var(--eb-navy-rgb), 0.04);
  --eb-shadow-lg: 0 12px 32px rgba(var(--eb-navy-rgb), 0.10), 0 4px 12px rgba(var(--eb-navy-rgb), 0.06);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
}

/* Stage that holds the iPhone frame, centered on a soft backdrop */
.stage {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(800px 600px at 20% 10%, #1a2a4d 0%, transparent 50%),
    radial-gradient(900px 700px at 80% 90%, #2d1f10 0%, transparent 55%),
    #0a1428;
  overflow: hidden;
}

/* Scale wrapper — fits the 402×874 iPhone into any viewport */
.phone-scaler {
  --phone-w: 402px;
  --phone-h: 874px;
  --scale: 1;
  width: var(--phone-w);
  height: var(--phone-h);
  transform: scale(var(--scale));
  transform-origin: center center;
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
  pointer-events: none;
}

.stage-label {
  position: fixed;
  top: 20px;
  left: 24px;
  color: rgba(255,255,255,0.65);
  font-family: var(--eb-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.stage-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--eb-amber);
  box-shadow: 0 0 12px var(--eb-amber);
}

/* App canvas inside iPhone */
.app {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--eb-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--eb-font);
}

.app-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.app-scroll::-webkit-scrollbar { display: none; }

/* Topbar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 70px 16px 12px;
  background: var(--eb-bg);
  flex-shrink: 0;
}

.topbar-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--eb-ink);
  letter-spacing: -0.01em;
}

.topbar-sub {
  font-size: 12px;
  color: var(--eb-muted);
  margin-top: 1px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line);
  color: var(--eb-ink);
  flex-shrink: 0;
}

.icon-btn.ghost { background: transparent; border-color: transparent; }
.icon-btn:active { transform: scale(0.96); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px;
  border-radius: 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: transform 0.08s ease, box-shadow 0.15s ease;
}
.btn:active { transform: scale(0.985); }

.btn-primary {
  background: var(--eb-amber);
  color: var(--eb-navy);
  box-shadow: 0 4px 14px rgba(var(--eb-amber-strong-rgb), 0.32), inset 0 1px 0 rgba(255,255,255,0.5);
}
.btn-primary:hover { background: var(--eb-amber-strong); }

.btn-secondary {
  background: var(--eb-navy);
  color: #fff;
  box-shadow: 0 4px 14px rgba(var(--eb-navy-rgb), 0.22);
}

.btn-ghost {
  background: var(--eb-bg-elev);
  color: var(--eb-ink);
  border: 1px solid var(--eb-line);
  box-shadow: var(--eb-shadow-sm);
}

.btn-block { width: 100%; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }

/* Cards */
.card {
  background: var(--eb-bg-elev);
  border-radius: var(--eb-r-lg);
  box-shadow: var(--eb-shadow-sm);
  border: 1px solid var(--eb-line-soft);
}

/* Mono numerals — used for price, codes, balances */
.mono { font-family: var(--eb-mono); font-feature-settings: 'tnum' 1; }

/* Price */
.price {
  font-family: var(--eb-mono);
  font-weight: 600;
  color: var(--eb-ink);
  letter-spacing: -0.01em;
  font-feature-settings: 'tnum' 1;
}

/* Pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
}

.pill-stock-ok { background: var(--eb-success-soft); color: var(--eb-success); }
.pill-stock-low { background: var(--eb-warn-soft); color: var(--eb-warn); }
.pill-stock-out { background: var(--eb-line-soft); color: var(--eb-muted); }
.pill-21 { background: #2C3447; color: #fff; }
.pill-amber { background: var(--eb-amber-soft); color: var(--eb-amber-strong); }
.pill-voucher { background: #ECE6F8; color: #5840A8; }

/* Section header */
.section {
  padding: 18px 16px 10px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.section-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--eb-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
.section-action {
  font-size: 12px;
  color: var(--eb-info);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Bottom-anchored CTA */
.bottom-bar {
  background: var(--eb-bg-elev);
  border-top: 1px solid var(--eb-line-soft);
  padding: 12px 16px 40px;
  box-shadow: 0 -8px 24px rgba(var(--eb-navy-rgb), 0.04);
  flex-shrink: 0;
}

/* Cluster wall map */
.cluster-wall {
  display: grid;
  gap: 6px;
  background: linear-gradient(180deg, var(--eb-navy) 0%, var(--eb-navy) 100%);
  border-radius: 18px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}

.cluster-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 80% at 50% -20%, rgba(255,255,255,0.10), transparent 60%);
  pointer-events: none;
}

.cube {
  aspect-ratio: 1;
  border-radius: 8px;
  background: linear-gradient(180deg, var(--eb-navy) 0%, var(--eb-navy) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  padding: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #fff;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cube:hover { transform: translateY(-1px); }

.cube[data-state="active"] {
  background: linear-gradient(180deg, var(--eb-amber) 0%, #D98C0E 100%);
  color: var(--eb-navy);
  border-color: rgba(255,255,255,0.5);
  box-shadow: 0 0 0 2px rgba(var(--eb-amber-rgb), 0.35), 0 8px 22px rgba(var(--eb-amber-strong-rgb), 0.45);
}

.cube[data-state="success"] {
  background: linear-gradient(180deg, #1F8A5B 0%, #145C3D 100%);
  color: #fff;
}

.cube[data-state="failed"] {
  background: linear-gradient(180deg, #D9483F 0%, #94251E 100%);
  color: #fff;
}

.cube[data-state="dim"] { opacity: 0.4; }

.cube-num {
  font-family: var(--eb-mono);
  font-size: 10px;
  font-weight: 600;
  opacity: 0.6;
  letter-spacing: 0.06em;
}

.cube-label {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* Inline 3x3 slot grid for cube detail */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  flex: 1;
  margin-top: 4px;
}

.slot {
  border-radius: 3px;
  background: rgba(255,255,255,0.08);
  position: relative;
}

.slot[data-state="active"] {
  background: var(--eb-amber);
  box-shadow: 0 0 8px var(--eb-amber);
  animation: pulse 1s ease-in-out infinite;
}

.slot[data-state="empty"] { background: rgba(255,255,255,0.03); }
.slot[data-state="success"] { background: rgba(31,138,91,0.9); }
.slot[data-state="failed"] { background: rgba(217,72,63,0.9); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

/* Category chip */
.chip-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 16px 12px;
  scrollbar-width: none;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line);
  font-size: 13px;
  font-weight: 500;
  color: var(--eb-ink-2);
  white-space: nowrap;
  flex-shrink: 0;
}

.chip[data-active="true"] {
  background: var(--eb-navy);
  color: #fff;
  border-color: var(--eb-navy);
}

/* Search */
.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line);
  border-radius: 14px;
  margin: 0 16px;
}
.search input {
  flex: 1;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--eb-ink);
  outline: none;
}
.search input::placeholder { color: var(--eb-faint); }

/* Product cards */
.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 4px 16px 24px;
}

.product-card {
  background: var(--eb-bg-elev);
  border-radius: 14px;
  border: 1px solid var(--eb-line-soft);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: transform 0.1s ease;
  min-width: 0;
}
.product-card:active { transform: scale(0.98); }
.product-card[data-out="true"] { opacity: 0.5; }

.product-thumb {
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--eb-bg-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.product-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--eb-ink);
  letter-spacing: -0.01em;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}

.product-meta {
  font-size: 11px;
  color: var(--eb-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  min-width: 0;
}
.product-price-row .price {
  font-size: 13px;
  flex-shrink: 0;
}
.product-price-row .pill {
  font-size: 10px;
  padding: 2px 6px;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* QRIS / Code visual */
.qris-code {
  width: 240px;
  height: 240px;
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  box-shadow: var(--eb-shadow-lg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Timer pip */
.timer-pip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--eb-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--eb-warn);
  background: var(--eb-warn-soft);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.timer-pip[data-tone="ok"] { color: var(--eb-success); background: var(--eb-success-soft); }
.timer-pip[data-tone="urgent"] { color: var(--eb-danger); background: var(--eb-danger-soft); }

/* Sheet */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--eb-overlay);
  z-index: 80;
  animation: fade 0.2s ease;
}

.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--eb-bg-elev);
  border-radius: 24px 24px 0 0;
  z-index: 81;
  padding: 14px 0 0;
  box-shadow: 0 -8px 32px rgba(var(--eb-navy-rgb), 0.18);
  animation: slideup 0.22s cubic-bezier(0.2,0.7,0.3,1);
  max-height: 92%;
  display: flex;
  flex-direction: column;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--eb-line);
  margin: 0 auto 10px;
}

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideup { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* Logo */
.eb-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--eb-font);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--eb-navy);
}
.eb-logo.light { color: #fff; }

.eb-logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--eb-navy);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--eb-amber);
  font-family: var(--eb-mono);
  font-weight: 700;
  font-size: 16px;
  position: relative;
}
.eb-logo.light .eb-logo-mark {
  background: var(--eb-amber);
  color: var(--eb-navy);
}

.eb-logo-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 5px;
  border: 1.5px solid var(--eb-amber);
  border-color: var(--eb-amber) transparent var(--eb-amber) transparent;
  opacity: 0.45;
}
.eb-logo.light .eb-logo-mark::after {
  border-color: var(--eb-navy) transparent var(--eb-navy) transparent;
  opacity: 0.4;
}

/* Status row */
.status-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line-soft);
}

.status-row .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Voucher card */
.voucher-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #FDF1D6 0%, #FFE9A8 100%);
  border-radius: 14px;
  padding: 14px 16px;
  overflow: hidden;
}
.voucher-card::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 84px;
  width: 14px;
  height: 14px;
  background: var(--eb-bg);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.voucher-card::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 84px;
  width: 1px;
  height: calc(100% - 16px);
  background: repeating-linear-gradient(
    to bottom,
    rgba(168,118,30,0.35) 0,
    rgba(168,118,30,0.35) 4px,
    transparent 4px,
    transparent 8px
  );
  transform: translateX(7px) translateY(-50%);
}

.voucher-icon {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: var(--eb-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--eb-navy);
  font-family: var(--eb-mono);
  font-weight: 700;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

/* Inline list */
.list { display: flex; flex-direction: column; }
.list-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--eb-bg-elev);
}
.list-row + .list-row { border-top: 1px solid var(--eb-line-soft); }

/* Loading dot animation */
.loader {
  display: inline-flex;
  gap: 4px;
}
.loader span {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: bouncedot 1.2s ease-in-out infinite;
}
.loader span:nth-child(2) { animation-delay: 0.15s; }
.loader span:nth-child(3) { animation-delay: 0.3s; }
@keyframes bouncedot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Empty state */
.empty {
  padding: 36px 24px;
  text-align: center;
  color: var(--eb-muted);
}

/* Underline tab */
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--eb-line);
  padding: 0 16px;
}
.tab {
  padding: 12px 4px;
  margin-right: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--eb-muted);
  position: relative;
  white-space: nowrap;
}
.tab[data-active="true"] {
  color: var(--eb-navy);
}
.tab[data-active="true"]::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0; right: 0;
  height: 2px;
  background: var(--eb-amber);
  border-radius: 2px;
}

/* Animated shimmer for "dispensing" state */
.shimmer {
  background: linear-gradient(
    90deg,
    var(--eb-bg-muted) 0%,
    var(--eb-bg-elev) 50%,
    var(--eb-bg-muted) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 1.8s ease-in-out infinite;
}
@keyframes shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Camera scanner viewport */
.scan-viewport {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 0, transparent 130px, rgba(0,0,0,0.65) 132px);
}
.scan-frame {
  position: absolute;
  top: 50%; left: 50%;
  width: 260px;
  height: 260px;
  transform: translate(-50%, -50%);
}
.scan-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 3px solid var(--eb-amber);
}
.scan-corner.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.scan-corner.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 8px; }
.scan-corner.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 8px; }
.scan-corner.br { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 8px; }

.scan-line {
  position: absolute;
  left: 8px; right: 8px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--eb-amber), transparent);
  box-shadow: 0 0 12px var(--eb-amber);
  animation: scan 2.4s ease-in-out infinite;
}
@keyframes scan {
  0% { top: 8px; }
  50% { top: calc(100% - 10px); }
  100% { top: 8px; }
}

/* NavBar — bottom tab bar with center elevated Scan FAB */
.navbar {
  position: relative;
  background: var(--eb-bg-elev);
  border-top: 1px solid var(--eb-line-soft);
  padding: 6px 8px 28px;
  box-shadow: 0 -6px 20px rgba(var(--eb-navy-rgb), 0.05);
  flex-shrink: 0;
  z-index: 4;
}

.navbar-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 84px 1fr 1fr;
  align-items: end;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px 4px;
  color: var(--eb-faint);
  transition: color 0.15s ease;
}
.nav-tab[data-active="true"] {
  color: var(--eb-navy);
}

.nav-tab-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
}

.nav-tab-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.nav-tab-badge {
  position: absolute;
  top: -3px;
  right: -6px;
  min-width: 14px;
  height: 14px;
  border-radius: 7px;
  padding: 0 4px;
  background: var(--eb-amber);
  color: var(--eb-navy);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--eb-bg-elev);
}

/* center FAB slot */
.navbar-fab-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 0 4px;
  position: relative;
}

.navbar-fab {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  border-radius: 30px;
  background: var(--eb-amber);
  color: var(--eb-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 6px 18px rgba(var(--eb-amber-strong-rgb), 0.42),
    0 2px 4px rgba(var(--eb-navy-rgb), 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.55);
  border: 3px solid var(--eb-bg-elev);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.navbar-fab:active {
  transform: translateX(-50%) scale(0.94);
}

.navbar-fab-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--eb-navy);
  margin-top: 36px;
}

/* When navbar is present, app-scroll needs no extra bottom padding —
   navbar is a sibling, not overlay */
.dispense-cluster {
  background: linear-gradient(180deg, var(--eb-navy) 0%, var(--eb-navy) 100%);
  border-radius: 24px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.dispense-cluster::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(60% 40% at 50% 0%, rgba(var(--eb-amber-rgb), 0.16), transparent 70%);
  pointer-events: none;
}

/* ─── Map full screen + machine sheet + machine detail ─── */

.map-full {
  position: absolute;
  inset: 0;
  background: #e8edf2;
}

.map-top {
  position: absolute;
  top: 52px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 1000;
}
.map-top .icon-btn {
  background: #fff;
  box-shadow: 0 4px 14px rgba(var(--eb-navy-rgb), 0.18);
  border: 0;
}
.map-title-pill {
  flex: 1;
  text-align: center;
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--eb-ink);
  box-shadow: 0 4px 14px rgba(var(--eb-navy-rgb), 0.18);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.map-quick {
  position: absolute;
  top: 96px;
  left: 0; right: 0;
  z-index: 1000;
  pointer-events: none;
}
.map-quick-scroll {
  display: flex;
  gap: 10px;
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  pointer-events: auto;
}
.map-quick-scroll::-webkit-scrollbar { display: none; }

.map-quick-card {
  flex-shrink: 0;
  min-width: 180px;
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--eb-line-soft);
  box-shadow: 0 4px 14px rgba(var(--eb-navy-rgb), 0.12);
  text-align: left;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.map-quick-card[data-active="true"] {
  border-color: var(--eb-amber);
  box-shadow: 0 0 0 2px rgba(var(--eb-amber-rgb), 0.3), 0 6px 18px rgba(var(--eb-navy-rgb), 0.15);
}
.map-quick-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--eb-ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-quick-area {
  font-size: 11px;
  color: var(--eb-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-quick-foot {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
}

/* Bottom sheet — drag-to-snap */
.map-sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: #fff;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -10px 30px rgba(var(--eb-navy-rgb), 0.20);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  transition: height 0.28s cubic-bezier(0.2, 0.7, 0.3, 1);
  touch-action: none;
}
.map-sheet-handle-area {
  padding: 10px 0 6px;
  display: flex;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}
.map-sheet-handle-area:active { cursor: grabbing; }
.map-sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--eb-line);
}
.map-sheet-content {
  flex: 1;
  overflow-y: auto;
  padding-top: 4px;
  padding-bottom: 24px;
  scrollbar-width: none;
}
.map-sheet-content::-webkit-scrollbar { display: none; }

/* Leaflet pin styling */
.eb-pin .eb-pin-inner {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 0;
  background: var(--eb-amber);
  color: var(--eb-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 13px;
  transform: rotate(-45deg);
  border: 2.5px solid var(--eb-navy);
  box-shadow: 0 3px 10px rgba(var(--eb-navy-rgb), 0.3);
}
.eb-pin .eb-pin-inner > * {
  transform: rotate(45deg);
}
.eb-pin .eb-pin-inner.active {
  background: var(--eb-navy);
  color: var(--eb-amber);
  transform: rotate(-45deg) scale(1.18);
  box-shadow: 0 0 0 3px rgba(var(--eb-amber-rgb), 0.45), 0 6px 16px rgba(var(--eb-navy-rgb), 0.4);
}
.eb-pin .eb-pin-inner.offline {
  background: #B0B6BF;
  color: #fff;
}

/* user dot */
.eb-user .eb-user-dot {
  position: absolute;
  inset: 4px;
  background: #2C6FE0;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(44,111,224,0.5);
  z-index: 2;
}
.eb-user .eb-user-pulse {
  position: absolute;
  inset: 0;
  background: rgba(44,111,224,0.3);
  border-radius: 50%;
  animation: user-pulse 2.4s ease-out infinite;
}
@keyframes user-pulse {
  0%   { transform: scale(0.8); opacity: 0.7; }
  100% { transform: scale(2.2); opacity: 0; }
}

/* Machine detail screen */
.machine-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  overflow: hidden;
  background: var(--eb-bg-muted);
  box-shadow: var(--eb-shadow-md);
}
.machine-hero-status {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}
/* ───────────────────────────────────────────────────────────
   MACHINE SCREEN (post-scan, single machine view)
   ─────────────────────────────────────────────────────────── */
.machine-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line-soft);
}
.machine-status-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--eb-navy);
  color: var(--eb-amber);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.machine-status-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--eb-ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.machine-status-sub {
  font-size: 11px;
  color: var(--eb-muted);
  margin-top: 2px;
}

/* MachineWall — small horizontal indicator of "you're at machine N of M" */
.machine-wall {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--eb-bg-muted);
  border-radius: 10px;
  flex-shrink: 0;
}
.machine-wall-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 6px;
  border-radius: 7px;
  color: var(--eb-muted);
  transition: background 0.12s ease;
}
.machine-wall-unit[data-active="true"] {
  background: var(--eb-navy);
  color: var(--eb-amber);
}
.machine-wall-num {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.02em;
}

/* ───────────────────────────────────────────────────────────
   DISPENSE SPINNER STAGE
   ─────────────────────────────────────────────────────────── */
.spinner-stage {
  padding: 8px 16px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.spinner-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* outer chassis ring */
.spinner-chassis {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle, transparent 65%, rgba(var(--eb-amber-rgb), 0.10) 70%, transparent 85%);
  border: 2px solid rgba(var(--eb-amber-rgb), 0.18);
  box-shadow:
    inset 0 0 24px rgba(0,0,0,0.4),
    0 0 40px rgba(var(--eb-amber-rgb), 0.15);
}

/* fixed top arrow showing the dispense slot */
.spinner-arrow {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 4;
  filter: drop-shadow(0 0 8px rgba(var(--eb-amber-rgb), 0.6));
}

/* rotating ring */
.spinner-ring {
  position: absolute;
  top: 9px;
  left: 9px;
  border-radius: 50%;
}

/* product thumbs sit on top of the ring */
.spinner-thumb {
  position: absolute;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0,0,0,0.35);
  border: 2px solid rgba(255,255,255,0.12);
  transition: transform 1.45s cubic-bezier(0.22, 1.05, 0.32, 1);
}
.spinner-thumb.active {
  border-color: var(--eb-amber);
  box-shadow: 0 0 0 3px rgba(var(--eb-amber-rgb), 0.4), 0 6px 14px rgba(var(--eb-amber-rgb), 0.5);
}

/* dispense flash when item drops */
.spinner-dispense-flash {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--eb-amber-rgb), 0.55), transparent 65%);
  animation: spinner-flash 0.7s ease-out;
  pointer-events: none;
}
@keyframes spinner-flash {
  0%   { opacity: 0; transform: translateX(-50%) scale(0.6); }
  40%  { opacity: 1; transform: translateX(-50%) scale(1.2); }
  100% { opacity: 0; transform: translateX(-50%) scale(1.8); }
}

/* Dispense tray below the spinner — where items "land" */
.dispense-tray {
  width: 220px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.dispense-tray-shelf {
  height: 4px;
  background: linear-gradient(180deg, rgba(var(--eb-amber-rgb), 0.4), rgba(var(--eb-amber-rgb), 0.05));
  border-radius: 2px;
  margin-bottom: 8px;
}
.dispense-tray-items {
  min-height: 48px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px dashed rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.tray-item {
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.2);
  animation: tray-drop 0.5s cubic-bezier(0.4, 1.5, 0.6, 1);
}
@keyframes tray-drop {
  0%   { transform: translateY(-40px) scale(0.8); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.ktp-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 16px 14px;
}
.ktp-progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.ktp-progress-dot {
  width: 22px; height: 22px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: var(--eb-bg-muted);
  color: var(--eb-faint);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 11px;
  border: 1.5px solid transparent;
  transition: all 0.18s ease;
}
.ktp-progress-step[data-state="active"] .ktp-progress-dot {
  background: var(--eb-amber);
  color: var(--eb-navy);
  border-color: var(--eb-amber);
  box-shadow: 0 0 0 4px rgba(var(--eb-amber-rgb), 0.18);
}
.ktp-progress-step[data-state="done"] .ktp-progress-dot {
  background: var(--eb-success);
  color: #fff;
  border-color: var(--eb-success);
}
.ktp-progress-label {
  font-size: 9px;
  font-weight: 600;
  color: var(--eb-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.ktp-progress-step[data-state="active"] .ktp-progress-label {
  color: var(--eb-navy);
}
.ktp-progress-step[data-state="done"] .ktp-progress-label {
  color: var(--eb-success);
}
.ktp-progress-line {
  flex: 1;
  height: 2px;
  background: var(--eb-bg-muted);
  margin-bottom: 14px; /* align with dot center, leaving label below */
  border-radius: 1px;
  transition: background 0.18s ease;
}
.ktp-progress-line[data-done="true"] {
  background: var(--eb-success);
}

/* Camera frame for KTP/selfie capture */
.ktp-mask {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}
.ktp-mask-cutout {
  position: relative;
  background: rgba(0,0,0,0.25);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.55);
  border-radius: 12px;
}
.ktp-corner {
  position: absolute;
  width: 24px; height: 24px;
  border: 3px solid var(--eb-amber);
  filter: drop-shadow(0 0 8px rgba(var(--eb-amber-rgb), 0.5));
}
.ktp-corner.tl { top: -2px;    left: -2px;    border-right: 0; border-bottom: 0; border-top-left-radius: 8px; }
.ktp-corner.tr { top: -2px;    right: -2px;   border-left: 0;  border-bottom: 0; border-top-right-radius: 8px; }
.ktp-corner.bl { bottom: -2px; left: -2px;    border-right: 0; border-top: 0;    border-bottom-left-radius: 8px; }
.ktp-corner.br { bottom: -2px; right: -2px;   border-left: 0;  border-top: 0;    border-bottom-right-radius: 8px; }
.ktp-scanline {
  position: absolute;
  left: 8px; right: 8px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--eb-amber), transparent);
  box-shadow: 0 0 10px var(--eb-amber);
  animation: ktp-scan-sweep 2.4s ease-in-out infinite;
}
@keyframes ktp-scan-sweep {
  0%   { top: 8px; opacity: 0.4; }
  50%  { top: calc(100% - 10px); opacity: 1; }
  100% { top: 8px; opacity: 0.4; }
}

/* Shutter button */
.ktp-shutter {
  width: 70px; height: 70px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s ease;
}
.ktp-shutter:active { transform: scale(0.92); }
.ktp-shutter-inner {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: #fff;
  display: block;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
}

/* Preview image frame (post-capture review) */
.ktp-preview {
  position: relative;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--eb-bg-muted);
  box-shadow: var(--eb-shadow-md);
}

/* Verified info row */
.ktp-info-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
}
.ktp-info-row + .ktp-info-row {
  border-top: 1px solid var(--eb-line-soft);
}
.ktp-info-k {
  font-size: 12px;
  color: var(--eb-muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.ktp-info-v {
  font-size: 13px;
  color: var(--eb-ink);
  font-weight: 500;
  text-align: right;
}
.ktp-info-v.mono {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Submission animation */
@keyframes ktp-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(var(--eb-amber-rgb), 0.5); }
  50%      { transform: scale(1.04); box-shadow: 0 0 0 14px rgba(var(--eb-amber-rgb), 0); }
}
@keyframes ktp-pop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.hero-scan {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 22px 18px;
  border-radius: 22px;
  background:
    radial-gradient(140% 100% at 0% 0%, rgba(var(--eb-amber-rgb), 0.22) 0%, transparent 55%),
    linear-gradient(135deg, var(--eb-navy) 0%, var(--eb-navy) 100%);
  color: #fff;
  border: 1.5px solid rgba(var(--eb-amber-rgb), 0.30);
  box-shadow:
    0 16px 36px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
  text-align: left;
}
.hero-scan::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(var(--eb-amber-rgb), 0.10) 1px, transparent 1px);
  background-size: 12px 12px;
  mask: radial-gradient(circle at 80% 50%, #000 0%, transparent 60%);
  -webkit-mask: radial-gradient(circle at 80% 50%, #000 0%, transparent 60%);
  pointer-events: none;
  opacity: 0.5;
}

.hero-scan-corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--eb-amber);
  pointer-events: none;
  filter: drop-shadow(0 0 6px rgba(var(--eb-amber-rgb), 0.5));
}
.hero-scan-corner.tl { top: 10px;    left: 10px;    border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.hero-scan-corner.tr { top: 10px;    right: 10px;   border-left: 0;  border-bottom: 0; border-top-right-radius: 6px; }
.hero-scan-corner.bl { bottom: 10px; left: 10px;    border-right: 0; border-top: 0;    border-bottom-left-radius: 6px; }
.hero-scan-corner.br { bottom: 10px; right: 10px;   border-left: 0;  border-top: 0;    border-bottom-right-radius: 6px; }

.hero-scan-line {
  position: absolute;
  left: 14px; right: 14px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--eb-amber), transparent);
  box-shadow: 0 0 10px var(--eb-amber);
  animation: hero-scan-sweep 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes hero-scan-sweep {
  0%   { top: 16px; opacity: 0.4; }
  50%  { top: calc(100% - 18px); opacity: 1; }
  100% { top: 16px; opacity: 0.4; }
}

.hero-scan-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--eb-amber);
  color: var(--eb-navy);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; position: relative;
  box-shadow: 0 6px 18px rgba(var(--eb-amber-rgb), 0.4), inset 0 1px 0 rgba(255,255,255,0.5);
}

.hero-scan-body { flex: 1; min-width: 0; position: relative; }
.hero-scan-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; color: #fff; line-height: 1.2; }
.hero-scan-sub { font-size: 11px; margin-top: 4px; color: rgba(255,255,255,0.65); line-height: 1.4; }

.hero-scan-cta {
  width: 36px; height: 36px;
  border-radius: 18px;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.18);
  display: flex; align-items: center; justify-content: center;
  color: var(--eb-amber);
  flex-shrink: 0; position: relative;
}

/* Horizontal scrollers */
.hscroll {
  display: flex;
  gap: 10px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  scroll-padding-left: 16px;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { scroll-snap-align: start; }

/* Promo banner */
.promo-scroller {
  display: flex;
  gap: 10px;
  padding: 0 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  scroll-padding: 0 16px;
}
.promo-scroller::-webkit-scrollbar { display: none; }

.promo-slide {
  flex: 0 0 calc(100% - 32px);
  scroll-snap-align: center;
  border-radius: 16px;
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background-color: var(--eb-bg-muted);
  box-shadow: 0 6px 20px rgba(var(--eb-navy-rgb), 0.10);
}

.promo-slide image-slot {
  width: 100%;
  height: 100%;
  display: block;
}

.promo-slide-cta {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--eb-amber);
  color: var(--eb-navy);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(var(--eb-amber-strong-rgb), 0.45);
  z-index: 2;
}

.promo-dots {
  display: flex; gap: 4px; justify-content: center; margin-top: 10px;
}
.promo-dot {
  width: 6px; height: 6px; border-radius: 3px;
  background: var(--eb-line);
  transition: width 0.2s ease, background 0.2s ease;
}
.promo-dot[data-active="true"] { width: 18px; background: var(--eb-navy); }

/* Nearby card */
.nearby-card {
  flex-shrink: 0;
  width: 156px;
  padding: 12px;
  border-radius: 14px;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line-soft);
  display: flex; flex-direction: column; gap: 6px;
  text-align: left;
  transition: transform 0.1s ease;
}
.nearby-card:active { transform: scale(0.98); }

.nearby-card-top { display: flex; align-items: center; justify-content: space-between; }
.nearby-card-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--eb-navy); color: var(--eb-amber);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nearby-card-name {
  font-size: 13px; font-weight: 600; color: var(--eb-ink);
  line-height: 1.2; letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nearby-card-area {
  font-size: 11px; color: var(--eb-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.nearby-card-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 4px; padding-top: 8px;
  border-top: 1px solid var(--eb-line-soft);
}

/* Popular product card */
.popular-card {
  flex-shrink: 0; width: 124px; padding: 8px;
  border-radius: 12px;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line-soft);
  display: flex; flex-direction: column; gap: 8px;
  text-align: left;
  transition: transform 0.1s ease;
}
.popular-card:active { transform: scale(0.98); }
.popular-card .product-thumb { width: 100%; }
.popular-card-body { display: flex; flex-direction: column; gap: 2px; padding: 0 2px 2px; min-width: 0; }
.popular-card-name {
  font-size: 12px; font-weight: 600; color: var(--eb-ink);
  line-height: 1.2; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 29px;
}
.popular-card-meta {
  font-size: 10px; color: var(--eb-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.popular-card-price { font-size: 12px; margin-top: 3px; }

/* Search result row (Cari screen) */
.search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line-soft);
  border-radius: 14px;
  text-align: left;
  transition: transform 0.08s ease;
}
.search-row:active { transform: scale(0.99); }

.search-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.search-row-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--eb-ink);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-row-meta {
  font-size: 11px;
  color: var(--eb-muted);
  display: flex;
  gap: 4px;
  align-items: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-row-foot {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.search-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

/* Home search bar — looks tappable, not focusable here (jumps to Cari screen) */
.home-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line);
  box-shadow: var(--eb-shadow-sm);
  color: var(--eb-faint);
  width: 100%;
  text-align: left;
  transition: transform 0.08s ease;
}
.home-search:active { transform: scale(0.99); }
.home-search-text {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--eb-faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.home-search-kbd {
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--eb-faint);
  background: var(--eb-bg-muted);
  padding: 3px 6px;
  border-radius: 5px;
  flex-shrink: 0;
}

/* Riwayat — month switcher pill + sort button */
.month-switcher {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line);
  border-radius: 10px;
  padding: 2px;
  overflow: hidden;
}

.month-switch-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--eb-navy);
  border-radius: 8px;
  flex-shrink: 0;
}
.month-switch-btn:disabled {
  color: var(--eb-line);
  cursor: default;
}
.month-switch-btn:not(:disabled):active {
  background: var(--eb-bg-muted);
}

.month-switch-label {
  flex: 1;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--eb-ink);
  letter-spacing: -0.01em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.month-switch-count {
  font-size: 10px;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  color: var(--eb-muted);
  background: var(--eb-bg-muted);
  padding: 1px 6px;
  border-radius: 4px;
}

.sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line);
  color: var(--eb-ink);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.08s ease;
}
.sort-btn:active { transform: scale(0.96); }
.claim-card {
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line-soft);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--eb-shadow-sm);
}

.claim-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 4px 12px;
  background: var(--eb-bg-muted);
  border: 1.5px solid var(--eb-line);
  border-radius: 10px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.claim-input:focus-within {
  border-color: var(--eb-amber);
  background: var(--eb-bg-elev);
}
.claim-input.error {
  border-color: var(--eb-danger);
  background: var(--eb-danger-soft);
  animation: claim-shake 0.32s ease-out;
}
@keyframes claim-shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}
.claim-input input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: transparent;
  font: inherit;
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--eb-ink);
  padding: 6px 0;
  text-transform: uppercase;
}
.claim-input input::placeholder {
  color: var(--eb-faint);
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Voucher success toast */
.voucher-toast {
  margin: 8px 16px 0;
  padding: 10px 12px;
  background: var(--eb-success-soft);
  border: 1px solid rgba(31,138,91,0.25);
  color: var(--eb-success);
  border-radius: 12px;
  display: flex; align-items: center; gap: 10px;
  animation: toast-in 0.28s cubic-bezier(.2,.7,.3,1);
  box-shadow: 0 4px 16px rgba(31,138,91,0.18);
}
@keyframes toast-in {
  from { transform: translateY(-12px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.voucher-new-pill {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 3;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--eb-success);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  box-shadow: 0 4px 10px rgba(31,138,91,0.35);
  animation: baru-pulse 1.6s ease-in-out infinite;
}
@keyframes baru-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.06); }
}
.how-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.how-step {
  padding: 12px 10px; border-radius: 12px;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line-soft);
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.how-step-icon {
  width: 32px; height: 32px; border-radius: 9px;
  background: var(--eb-amber-soft); color: var(--eb-amber-strong);
  display: flex; align-items: center; justify-content: center;
}
.how-step-title { font-size: 12px; font-weight: 700; color: var(--eb-ink); letter-spacing: -0.01em; }
.how-step-desc { font-size: 10px; color: var(--eb-muted); line-height: 1.35; margin-top: 2px; }

/* ─── Product Detail (Cari arrival) ────────────────────────── */
.machine-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--eb-bg-elev);
  border: 1px solid var(--eb-line-soft);
  border-radius: 14px;
  transition: transform 0.08s ease;
}
.machine-row:active { transform: scale(0.99); }

.machine-row-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--eb-navy); color: var(--eb-amber);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.machine-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.machine-row-name {
  font-size: 14px; font-weight: 600;
  color: var(--eb-ink); letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.machine-row-area {
  font-size: 11px; color: var(--eb-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.machine-row-foot {
  display: flex; align-items: center; gap: 6px;
  margin-top: 5px; flex-wrap: wrap;
}

/* ─── Map preview ─────────────────────────────────────────── */
.map-preview {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
}
.map-preview-frame {
  display: block;
  width: 100%;
  height: 200px;
  border-radius: 16px;
  background: var(--eb-bg-muted);
  position: relative;
  overflow: hidden;
  border: 1px solid var(--eb-line-soft);
  padding: 0;
  cursor: pointer;
}
.map-preview-canvas {
  width: 100%;
  height: 100%;
  background: #eef2f6;
}

/* tint leaflet tiles to match brand — light blue/cream feel */
.map-preview-canvas .leaflet-tile {
  filter:
    grayscale(0.20)
    saturate(0.85)
    contrast(0.95)
    sepia(0.05);
}

.map-preview-overlay {
  position: absolute;
  bottom: 10px; left: 10px;
  z-index: 401;
  pointer-events: none;
}
.map-preview-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--eb-navy);
  color: var(--eb-amber);
  font-size: 11px; font-weight: 700;
  box-shadow: 0 4px 12px rgba(var(--eb-navy-rgb), 0.25);
}

.map-locoff {
  position: absolute;
  top: 12px; right: 12px;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--eb-line);
  font-size: 10px; font-weight: 600;
  color: var(--eb-ink);
  z-index: 401;
  backdrop-filter: blur(8px);
}

/* Leaflet custom pin */
.eb-pin {
  background: transparent !important;
  border: 0 !important;
}
.eb-pin-inner {
  position: relative;
  width: 32px; height: 32px;
  border-radius: 50% 50% 50% 0;
  background: var(--eb-amber);
  border: 2.5px solid var(--eb-navy);
  transform: rotate(-45deg);
  display: flex; align-items: center; justify-content: center;
  color: var(--eb-navy);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.25);
}
.eb-pin-inner::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px dashed rgba(var(--eb-navy-rgb), 0.25);
}
.eb-pin-inner > * {
  transform: rotate(45deg);
}

/* User location pulse */
.eb-user {
  background: transparent !important;
  border: 0 !important;
}
.eb-user-dot {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #2C6FE0;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  z-index: 2;
}
.eb-user-pulse {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 14px; height: 14px;
  border-radius: 50%;
  background: rgba(44,111,224,0.45);
  animation: eb-pulse 1.6s ease-out infinite;
}
@keyframes eb-pulse {
  0%   { width: 14px;  height: 14px;  opacity: 0.7; }
  100% { width: 48px;  height: 48px;  opacity: 0;   }
}
