html {
  background-color: #F4F1EC;
}

html[data-theme="dark"] {
  background-color: #121212;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  color-scheme: light;
  --bg-base: #F4F1EC;
  --bg-glow: #FAF6F0;
  --ink: #1A1A1A;
  --ink-inverse: #FFFFFF;
  --muted: #7A6F66;
  --accent: #ff3e3e;
  --logo-pdf: #1A1A1A;
  --logo-cafe: #7A6F66;
  --sheet: rgba(255, 255, 255, 0.72);
  --glass: blur(32px) saturate(180%);
  --glass-border: rgba(255, 255, 255, 0.6);

  --bg-elevated: #FFFFFF;
  --border-light: rgba(18, 18, 18, 0.08);
  --border-dashed: rgba(140, 133, 123, 0.4);
  --hover-layer: rgba(18, 18, 18, 0.04);
  --pill-bg: rgba(255, 255, 255, 0.5);
  --pill-border: rgba(255, 255, 255, 0.8);
  --success: #22C55E;

  --mono: 'IBM Plex Mono', monospace;
  --display: 'Playfair Display', serif;
  --spring: cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

html.low-data *,
html.low-data *::before,
html.low-data *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

* {
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none;
  user-select: none;
}

input,
textarea,
.copy-num,
#cashTokenDisplay,
.addr-detail,
.acc-badge {
  user-select: text;
  -webkit-user-select: text;
}

.btn-primary,
.remove-btn,
.action-btn,
.dropzone-doc,
.theme-toggle,
.pill-btn {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-base);
  background-image:
    radial-gradient(circle at 50% 0%, var(--bg-glow) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.05'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#offlineBanner {
  display: none;
  background: var(--accent);
  color: var(--ink-inverse);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-align: center;
  padding: 0.5rem 1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  z-index: 1001;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }

  to {
    transform: none;
  }
}

@keyframes double-pulse {

  0%,
  100% {
    text-shadow: 0 0 2px rgba(239, 68, 68, 0.4);
    color: #EF4444 !important;
    transform: scale(1);
  }

  15% {
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.9);
    color: #EF4444 !important;
    transform: scale(1.08);
  }

  30% {
    text-shadow: 0 0 4px rgba(239, 68, 68, 0.5);
    color: #EF4444 !important;
    transform: scale(1.04);
  }

  45% {
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.7);
    color: #EF4444 !important;
    transform: scale(1.08);
  }
}

.thumbnail-toxic {
  box-shadow: 0 0 var(--glow-blur) var(--glow-spread) var(--glow-color);
  border: none !important;
}

.ink-warning-badge {
  position: absolute;
  top: -6px;
  right: -4px;
  color: var(--muted);
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 700;

  text-shadow: 0 0 4px rgba(255, 255, 255, 0.9), 0 1px 2px rgba(255, 255, 255, 0.8);

  pointer-events: none;
  z-index: 20;
}

.cart-item-disclaimer {
  font-family: var(--display);
  font-size: 0.7rem;
  color: var(--muted);
  margin-top: 0.4rem;
  text-align: left;
  font-style: italic;
}

.thumbnail-rejected {
  border-radius: 8px;
}

.remove-btn.alert-glow {
  animation: double-pulse 1s ease-in-out infinite;
  background: transparent !important;
  opacity: 0.9 !important;
  color: #EF4444 !important;
  font-family: var(--display);
  text-align: left;
  font-style: italic;
}

.cart-locked {
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
  filter: grayscale(10%);
}

.jump-dot {
  display: inline-block;
  animation: dot-jump 1.4s infinite ease-in-out both;
  margin-left: 1px;
}

.jump-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.jump-dot:nth-child(2) {
  animation-delay: -0.16s;
}

.jump-dot:nth-child(3) {
  animation-delay: 0s;
}

@keyframes dot-jump {

  0%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-4px);
  }
}

header {
  padding: 2.5rem 1.5rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

.logo {
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  opacity: 1;
  color: var(--logo-pdf);
}

.logo:active {
  opacity: 0.6;
}

.logo .cafe {
  color: var(--logo-cafe);
  font-style: italic;
  font-weight: 500;
}

/* ── DYNAMIC AUTH PILL ── */
.printer-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  font-weight: 600;
  background: var(--pill-bg);
  border: 1px solid var(--pill-border);
  border-radius: 99px;
  padding: 0.6rem 1rem;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  backdrop-filter: var(--glass);
  height: 38px;
  /* Slightly taller for emoji */
  transition: max-width 0.5s var(--spring), padding 0.5s var(--spring), background 0.4s ease;
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.printer-pill.pill-shrink {
  max-width: 105px;
}

.pill-text-window {
  height: 18px;
  /* Taller window stops emoji clipping! */
  overflow: hidden;
  position: relative;
  width: 100%;
}

.pill-slider {
  display: flex;
  flex-direction: column;
  transition: transform 0.5s var(--spring);
}

.printer-pill.pill-shrink .pill-slider {
  transform: translateY(-18px);
  /* Matches new height */
}

.pill-slider span {
  height: 18px;
  line-height: 18px;
  display: flex;
  align-items: center;
}

/* Pure Green Dot - No Orange */
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: all 0.4s ease;
}

.dot.ready,
.dot.login-glow {
  background: var(--success);
  box-shadow: 0 0 12px rgba(34, 197, 94, 0.6);
}

.dot.checking {
  background: var(--muted);
  opacity: 0.7;
  box-shadow: none;
}

.dot.error {
  background: var(--accent);
  box-shadow: 0 0 12px rgba(255, 62, 62, 0.6);
}

.wave-emoji {
  display: inline-block;
  font-size: 0.9rem;
  margin-right: 4px;
  animation: waveHand 2.5s infinite;
  transform-origin: 70% 70%;
  padding-bottom: 2px;
}

@keyframes waveHand {

  0%,
  60%,
  100% {
    transform: rotate(0deg) scale(1);
  }

  10%,
  30% {
    transform: rotate(14deg) scale(1.2);
  }

  20%,
  40% {
    transform: rotate(-8deg) scale(1.2);
  }

  50% {
    transform: rotate(10deg) scale(1.2);
  }
}

/* ── PAPER DELIVERY CARDS ── */
.del-card.paper-style {
  background: #FAF8F5;
  /* Warm paper tint */
  border: 1px solid rgba(140, 133, 123, 0.25);
  box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.02);
  border-radius: 12px;
}

.del-card.paper-style.active {
  border-color: var(--ink);
  background: #FFFFFF;
  box-shadow: 4px 6px 16px rgba(0, 0, 0, 0.06);
}

.del-card.paper-style .del-title {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
}

.error-banner {
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--accent);
  /* Your red color */
  margin-top: 0.4rem;
  margin-bottom: 1.2rem;
  padding: 0 1rem;
  white-space: pre-wrap;
}

main {
  background: var(--sheet);
  backdrop-filter: var(--glass);
  width: 100%;
  max-width: 600px;
  margin: 1.5rem auto 0 auto;
  border-radius: 40px 40px 0 0;
  padding: 2rem 2rem 2rem;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.05);
  flex-grow: 1;
  position: relative;
  z-index: 20;
  border: 1px solid var(--glass-border);
  border-bottom: none;
}

@media (prefers-reduced-motion: reduce) {

  main,
  footer,
  .printer-pill {
    backdrop-filter: none !important;
  }
}

.screen {
  display: none;
  opacity: 0;
}

.screen.active {
  display: block;
  animation: popIn 0.4s var(--spring) forwards;
  will-change: transform, opacity;
}

@keyframes popIn {
  0% {
    opacity: 0;
    transform: translateY(15px);
  }

  100% {
    opacity: 1;
    transform: none;
  }
}

#scPageSelector.active,
#scVisualPreview.active,
#scPay.active {
  display: flex !important;
  flex-direction: column !important;
}

.section-title {
  font-family: var(--display);
  font-size: 2.2rem;
  margin-bottom: 1.5rem;
  text-align: center;
  opacity: 0.9;
}

.upload-group {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.dropzone-doc {
  position: relative;
  margin-top: 0.1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3.8rem 1rem;
  /* Increased from 3.2rem to make the dropzone much taller */
  border-radius: 24px;
  cursor: pointer;
  background-color: var(--bg-elevated);
  border: 2px dashed var(--border-dashed);
  /* Slightly thicker dashes to match your image */
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.dropzone-doc:hover {
  background-color: var(--bg-elevated);
  transform: translateY(-2px);
  border-color: var(--muted);
  box-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.08);
}

.dz-icon-svg {
  width: 32px;
  height: 32px;
  margin-bottom: 0.5rem;
  transform: translateY(-10px);
  color: var(--muted);
  opacity: 0.9;
  stroke-width: 2px;
  transition: transform 0.2s ease, color 0.2s ease;
  /* Smooth icon animation */
}

.dropzone-doc:hover .dz-icon-svg {
  color: var(--ink);
  transform: translateY(-12px) scale(1.05);
  /* Icon pops up and grows slightly */
}

.dz-title {
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.3rem;
  transform: translateY(-14px);
}

.dz-sub {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transform: translateY(-5px);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#cancelUploadBtn {
  display: none;
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: var(--hover-layer);
  border: none !important;
  outline: none !important;
  border-radius: 12px;
  color: var(--muted);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  line-height: 1;
  z-index: 20;
  /* Instant Snap: Only animate transform, not colors */
  transform: none;
  -webkit-tap-highlight-color: transparent;
}

#cancelUploadBtn:hover {
  background: rgba(232, 61, 50, 0.1);
  color: var(--accent);
}

.action-group {
  display: flex;
  gap: 0.8rem;
  width: 100%;
  margin: 1.2rem 0 0 0;
}

.action-btn {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
  border: 1.5px dashed var(--border-dashed);
  border-radius: 16px;
  padding: 1rem 0;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  touch-action: manipulation;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
}

.action-btn svg {
  width: 24px;
  height: 24px;
  stroke-width: 2px;
  color: var(--muted);
  opacity: 0.9;
  transition: transform 0.2s ease;
}

.action-btn:hover {
  border-style: solid;
  border-color: var(--ink);
  background: var(--hover-layer);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.action-btn:hover svg {
  color: var(--ink);
}

.file-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--hover-layer);
  padding: 1rem 1.2rem;
  border-radius: 16px;
  margin-bottom: 0.8rem;
}

.file-row-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  overflow: hidden;
}

.file-badge {
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  background: var(--border-light);
  color: var(--muted);
  padding: 2px 7px;
  border-radius: 99px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.file-badge.docx {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.file-badge.img {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
}

.file-name {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.toppings-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1rem;
  border-bottom: 2px dashed var(--border-dashed);
  padding-bottom: 1rem;
}

.toppings-header h1 {
  margin: 0;
  font-size: 2.2rem;
}

.price-tag {
  font-family: var(--display);
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  letter-spacing: normal;
}

.cart-item {
  background: var(--bg-elevated);
  border-radius: 20px;
  padding: 1rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid var(--border-light);
  position: relative;
  z-index: 10;
}

.cart-thumb-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
  width: 64px;
}

.cart-thumb {
  width: 100%;
  height: 80px;
  background: var(--bg-base);
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-light);
}

.copy-ctrl {
  display: flex;
  align-items: center;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  width: 100%;
  height: 24px;
  overflow: hidden;
}

.copy-btn {
  flex: 1;
  border: none !important;
  outline: none !important;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  padding-bottom: 2px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.copy-btn:hover {
  background: var(--hover-layer);
  color: var(--ink);
}

.copy-num {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  min-width: 16px;
  user-select: none;
}

.cart-content {
  flex-grow: 1;
  min-width: 0;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.8rem;
  gap: 0.5rem;
}

.fname {
  flex: 1;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
  padding-top: 2px;
}

.seg-control {
  display: flex;
  background: var(--bg-base);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 0.6rem;
  gap: 4px;
}

.seg-btn {
  flex: 1;
  border: none !important;
  outline: none !important;
  background: transparent;
  padding: 10px 8px;
  border-radius: 9px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  text-transform: uppercase;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.seg-btn.active {
  background: var(--ink);
  color: var(--ink-inverse);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.seg-control.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.fulfilment-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg-base);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 5px;
  margin: 0 0 6.5rem;
}

.fulfilment-tab {
  border: none;
  background: transparent;
  color: var(--muted);
  border-radius: 12px;
  padding: 0.85rem 0.6rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
}

.fulfilment-tab.active {
  background: var(--ink);
  color: var(--ink-inverse);
}

#addMoreBtn {
  opacity: 1;
}


#goDone {
  opacity: 0.95 !important;
  transition: none !important;
}

#goDone:active:not(:disabled) {
  opacity: 1 !important;
  background: #000000 !important;
  filter: none !important;
  transform: none !important;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.2) !important;
}

.btn {
  display: block;
  width: 100%;
  padding: 1.2rem;
  background: var(--ink);
  color: var(--ink-inverse);
  border: none !important;
  outline: none !important;
  border-radius: 99px;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.2);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  opacity: 0.95;
  transition: transform 0.2s var(--spring), filter 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

.btn.outline {
  background: var(--hover-layer);
  border: 1.5px dashed var(--border-dashed) !important;
  color: var(--ink);
  box-shadow: none;
}

.btn:active:not(:disabled) {
  opacity: 1 !important;
  filter: brightness(0.3) !important;
  transform: scale(0.97) translateY(2px);
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.2);
  transition: all 0.05s ease !important;
  -webkit-tap-highlight-color: transparent !important;
}

.btn[data-busy="true"] {
  background: #000000 !important;
  color: #ffffff !important;
  opacity: 1 !important;
  cursor: wait !important;
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.4) !important;
  transform: scale(0.99);
  animation: btn-progress 1.5s infinite ease-in-out;
}

@keyframes btn-progress {

  0%,
  100% {
    box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.4);
  }

  50% {
    box-shadow: 0 8px 24px 0px rgba(0, 0, 0, 0.6);
  }
}

.btn:disabled:not([data-busy="true"]) {
  background: var(--border-light) !important;
  color: var(--muted) !important;
  cursor: not-allowed;
  box-shadow: none;
  border: none !important;
}

#cartItems {
  padding-bottom: 7rem;
}

.action-bar {
  position: sticky;
  bottom: 0;
  padding: 1.5rem 0.5rem;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom));
  margin-left: -0.5rem;
  width: calc(100% + 1rem);
  background: transparent;
  /* CHANGED: The "strap" is completely gone */
  display: flex;
  gap: 1rem;
  z-index: 100;
  pointer-events: none;
  /* Let touches pass through the invisible areas */
}

.action-bar .btn {
  margin: 0;
  pointer-events: auto;
  /* Re-enable touches on the button itself */
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  /* Gives the button a premium floating pop */
}

#paySummary {
  background: transparent;
  border: none;
}


#scPay .invoice-row {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem 0;
  border-bottom: 1px dashed var(--border-dashed);
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 500;
  align-items: center;
}

#scPay .total-row {
  text-align: right;
  margin-bottom: 1.5rem;
  border-top: 1px dashed var(--border);
  padding-top: 1.5rem;
}

#scPay .total-val {
  font-family: var(--display);
  font-size: 5.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  margin-top: 0.5rem;
  letter-spacing: normal;
}

.progress-bar {
  height: 4px;
  background: var(--border-light);
  border-radius: 99px;
  overflow: hidden;
  margin: 3rem 0;
}

.progress-fill {
  height: 100%;
  background: var(--ink);
  width: 0%;
  transition: 0.8s ease;
}

.progress-fill.indeterminate {
  width: 40%;
  animation: slide 1.5s infinite linear;
}

@keyframes slide {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(300%);
  }
}

.err-msg {
  color: var(--accent);
  font-size: 0.8rem;
  text-align: center;
  margin-top: 1rem;
  min-height: 1.2em;
  font-family: var(--mono);
}

.id-drop-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4rem;
  margin-bottom: 5rem;

}

.id-dropzone {
  position: relative;
  background-color: var(--bg-elevated);
  border-radius: 16px;
  border: 1.5px dashed var(--border-dashed);
  aspect-ratio: 1.58 / 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.id-dropzone:hover {
  background: var(--hover-layer);
  border-color: var(--ink);
  border-style: solid;
  transform: translateY(-2px);
}

.id-dropzone.has-file {
  border: 1px solid var(--border-light);
  background: transparent;
}

.id-dropzone input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 10;
}

.id-dz-icon {
  width: 28px;
  height: 28px;
  stroke-width: 1.5px;
  color: var(--muted);
  margin-bottom: 8px;
  transition: transform 0.2s ease;
}

.id-dropzone:hover .id-dz-icon {
  transform: scale(1.1);
  color: var(--ink);
}

.id-dz-text {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.id-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.id-preview-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
}

.id-dropzone:hover .id-preview-overlay {
  opacity: 1;
}

.id-overlay-text {
  color: #FFF;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.remove-btn {
  background: transparent;
  border: none !important;
  outline: none !important;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.remove-btn:hover {
  color: var(--accent);
}

.dl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 100%;
  padding: 6px 0;
  border-radius: 8px;
  text-decoration: none !important;
  outline: none !important;
  background: transparent;
  border: 1px dashed var(--border-dashed);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dl-btn:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--hover-layer);
}

.dl-btn svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.5px;
  flex-shrink: 0;
}

footer {
  background: var(--sheet);
  backdrop-filter: var(--glass);
  padding: 9rem 3rem 1.5rem;
  text-align: center;
  font-family: var(--mono);
  font-size: 0.75rem;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  border-left: 1px solid var(--glass-border);
  border-right: 1px solid var(--glass-border);
  position: relative;
  z-index: 20;
}

.footer-row {
  display: flex;
  align-items: center;
  gap: 15px;
  white-space: nowrap;
  width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 5px;
}

.footer-row::before,
.footer-row::after {
  content: '';
  margin: auto;
}

.footer-row::-webkit-scrollbar {
  display: none;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px dotted var(--border-dashed);
  padding-bottom: 2px;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--ink);
}

.support-hours {
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: 0.02em;
}

.footer-brand {
  font-family: var(--display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.footer-brand .cafe {
  color: var(--muted);
  font-style: italic;
  font-weight: 500;
}

.venture-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

@media (max-width: 480px) {
  header {
    padding: 1.5rem 1rem;
  }

  main {
    border-left: none;
    border-right: none;
  }

  footer {
    border-left: none;
    border-right: none;
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

@media (max-width: 380px), (prefers-reduced-motion: reduce) {
  body {
    background-image: none;
  }

  main,
  footer {
    backdrop-filter: none;
  }

  .section-title {
    font-size: 1.9rem;
  }

  #scPay .total-val,
  .total-val,
  #pmTotal {
    font-size: 4rem !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen.active {
    animation: none;
    opacity: 1;
  }

  .progress-fill.indeterminate {
    animation: none;
    width: 60%;
  }
}

.close-btn-sleek {
  position: absolute;
  top: 1rem;
  right: 1rem;
  /* Moved higher and further right */
  background: var(--hover-layer);
  border: none !important;
  border-radius: 12px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--muted);
  cursor: pointer;
  z-index: 50;
  -webkit-tap-highlight-color: transparent;
}

.close-btn-sleek:hover {
  color: var(--ink);
  background: var(--border-light);
}

.size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.size-card {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-light);
  border-radius: 16px;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  outline: none !important;
  -webkit-tap-highlight-color: transparent;
}

.size-card svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.5px;
  color: var(--muted);
  flex-shrink: 0;
}

.sc-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-title {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.sc-dim {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--muted);
}

.size-card.active {
  border-color: var(--ink);
  background: var(--hover-layer);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.size-card.active svg {
  color: var(--ink);
  stroke-width: 2px;
}

.ai-grid-loader {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 1rem 0;
  margin-bottom: 1.5rem;
}

.ai-grid-loader.active {
  display: grid;
}

.ai-cell {
  background: var(--hover-layer);
  border-radius: 8px;
  aspect-ratio: 3/4;
  animation: ai-pulse 1.5s infinite ease-in-out;
}

.ai-cell:nth-child(1) {
  animation-delay: 0s;
}

.ai-cell:nth-child(2) {
  animation-delay: 0.2s;
}

.ai-cell:nth-child(3) {
  animation-delay: 0.4s;
}

.ai-cell:nth-child(4) {
  animation-delay: 0.1s;
}

.ai-cell:nth-child(5) {
  animation-delay: 0.3s;
}

.ai-cell:nth-child(6) {
  animation-delay: 0.5s;
}

@keyframes ai-pulse {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.98);
  }

  50% {
    opacity: 1;
    transform: scale(1);
    background: var(--border-light);
  }
}

/* ── High-End Price Shimmer (Perplexity Style) ── */
.shimmer-active {
  display: inline-block;
  background: linear-gradient(110deg, var(--ink) 30%, var(--muted) 50%, var(--ink) 70%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: sleek-shimmer 3.5s ease-in-out infinite;
}

@keyframes sleek-shimmer {
  0% {
    background-position: 200% 0;
    transform: translateY(0);
    filter: drop-shadow(0 0 0 transparent);
  }

  50% {
    transform: translateY(-2px);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.08));
  }

  100% {
    background-position: -200% 0;
    transform: translateY(0);
    filter: drop-shadow(0 0 0 transparent);
  }
}

/* ── Page Selector Grid ── */
.page-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  /* Max-height tuned to show exactly 3 rows (15 boxes) before scrolling */
  max-height: 45vh;
  overflow-y: auto;
  padding: 0.5rem 0;
  /* Blocks pull-to-refresh on mobile */
  overscroll-behavior-y: contain;
}

.page-box {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 600;
  /* Unselected: slightly transparent light background */
  opacity: 0.95;
  background: rgba(0, 0, 0, 0.02);
  color: var(--ink);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.page-box.selected {
  /* Selected: Darker, solid, white text */
  background: #1a1a1a;
  color: #ffffff !important;
  border-color: #1a1a1a;
  opacity: 1;
  transform: scale(0.95);
}

.page-box.disabled {
  opacity: 0.25;
  pointer-events: none;
  background: var(--hover-layer);
  border-color: transparent;
}

.manual-page-input {
  width: 100%;
  border: 2px solid transparent;
  border-radius: 16px;
  padding: 1.2rem;
  font-family: var(--mono);
  font-size: 1.1rem;
  outline: none;
  color: #ffffff !important;
  background-color: #2a2a2a !important;
}

.manual-page-input::placeholder {
  color: rgba(255, 255, 255, 0.4) !important;
}

/* ── QUICK PREVIEW LIGHTBOX ── */
.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(255, 255, 255, 0.1);
  /* Pure transparent with barely any tint */
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-out;
}

.preview-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.preview-body {
  flex: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 90px;
  /* Leave space for the bottom bar */
}

.preview-img-tag {
  max-width: 95%;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ── BOLD BLACK BOTTOM BAR ── */
.preview-bottom-bar {
  position: fixed;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  background: #000000;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 16px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
}

.preview-title {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-back-btn {
  background: #ffffff;
  color: #000000;
  border: none;
  outline: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  text-transform: uppercase;
}

.preview-back-btn:active {
  transform: scale(0.96);
  background: #f0f0f0;
}

/* ── VISUAL PREVIEW GRID ── */
.vp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.vp-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.414;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg-elevated);
  border: 3px solid transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.vp-thumb-wrap:active {
  transform: scale(0.97);
}

.vp-thumb-wrap.selected {
  border-color: var(--ink);
}

.vp-thumb-wrap::after {
  content: '';
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  box-sizing: border-box;
  background-color: rgba(255, 255, 255, 0.85);
  border: 2px solid var(--ink);
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.vp-thumb-wrap.selected::after {
  background-color: var(--ink);
  border-color: var(--ink);
  background-image: url('data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 24 24" fill="white" xmlns="http://www.w3.org/2000/svg"><rect x="4" y="4" width="16" height="16" rx="4"/></svg>');
  background-repeat: no-repeat;
  background-position: center;
}

.vp-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

@keyframes upi-slide {

  0%,
  100% {
    transform: translateY(1px) translateX(0);
  }

  50% {
    transform: translateY(1px) translateX(4px);
  }
}

.upi-icon {
  margin-left: 8px;
  animation: upi-slide 1.5s ease-in-out infinite;
}

/* ── PREMIUM DELIVERY CARDS (Zepto Style) ── */
.del-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-light);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  cursor: pointer;
  transition: all 0.2s var(--spring);
  -webkit-tap-highlight-color: transparent;
}

.del-card.active {
  border-color: var(--ink);
  background: var(--hover-layer);
  transform: scale(0.98);
}

.del-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.del-title {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}

.del-price {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--muted);
}

.del-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.del-card.active .del-radio {
  border-color: var(--ink);
}

.del-card.active .del-radio::after {
  content: '';
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  animation: popIn 0.3s var(--spring) forwards;
}

/* ── ACCOUNT SCREEN STYLES ── */
.account-card {
  background: var(--ink);
  color: var(--ink-inverse);
  border-radius: 20px;
  padding: 1.5rem;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
}

.acc-badge {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.15);
  color: #FFF;
  padding: 4px 10px;
  border-radius: 99px;
  align-self: flex-start;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.acc-name {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
}

.acc-linked {
  font-family: var(--mono);
  font-size: 0.75rem;
  opacity: 0.8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.acc-tab {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-light);
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 0.8rem;
  cursor: pointer;
  transition: all 0.2s var(--spring);
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.acc-tab:active {
  transform: scale(0.98);
}

.acc-tab:hover {
  background: var(--hover-layer);
  border-color: var(--ink);
}

.address-card {
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-light);
  border-radius: 16px;
  padding: 1.2rem;
  margin-bottom: 0.8rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.addr-title {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.addr-detail {
  font-family: var(--display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.3;
}

.addr-delete {
  background: transparent;
  border: none;
  color: var(--accent);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 5px;
}

/* ── AUTH CARD UI ── */
.auth-card {
  width: 100%;
  max-width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  position: relative;
  transition: all 0.3s ease;
}

.auth-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.auth-header:hover {
  background: var(--hover-layer);
  border-radius: 20px 20px 0 0;
}

.auth-chevron {
  transition: transform 0.3s ease;
}

.auth-chevron.open {
  transform: rotate(180deg);
}

.auth-dropdown {
  position: absolute;
  top: 3.2rem;
  left: 0;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: 0 0 16px 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  z-index: 50;
  overflow: hidden;
  animation: popIn 0.2s var(--spring) forwards;
}

.auth-option {
  padding: 1rem 1.2rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
}

.auth-option:last-child {
  border-bottom: none;
}

.auth-option:hover {
  background: var(--hover-layer);
}

.auth-body {
  padding: 2.5rem 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 120px;
}
