/*!*************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./app/globals.css ***!
  \*************************************************************************************************************************************************************************************************************************************************************/
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  max-width: 540px;
  margin: 0 auto;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

/* ── Top bar ── */
#topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: transparent;
  flex-shrink: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .95rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.3px;
}

.brand-logo {
  height: 20px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.brand-badge {
  align-self: flex-end;
  font-family: 'Courier New', ui-monospace, monospace;
  font-size: .6rem;
  font-weight: 500;
  color: var(--dim);
  letter-spacing: 0;
}

.session-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--orange);
  flex-shrink: 0;
}

.dot.green {
  background: var(--green);
}

#session-label {
  font-size: .75rem;
  color: var(--dim);
}

.btn-sm {
  padding: 4px 9px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--dim);
  border-radius: 5px;
  font-size: .72rem;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-sm:active {
  background: var(--panel);
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.profile-icon {
  width: 18px;
  height: 18px;
  color: var(--dim);
  flex-shrink: 0;
}

.profile-email {
  font-size: .72rem;
  color: var(--dim);
  white-space: nowrap;
}

.signout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  margin-left: 2px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--dim);
  cursor: pointer;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s;
}

.signout-btn svg {
  width: 17px;
  height: 17px;
}

.signout-btn:hover {
  background: var(--red-bg-subtle);
  color: var(--red);
}

.signout-btn:active {
  background: var(--red-bg);
}

/* ── Sainsbury's login prompt ── */
#login-prompt {
  padding: 10px 0 4px;
}

#login-prompt p {
  font-size: .7rem;
  color: var(--dim);
  margin-top: 7px;
  line-height: 1.4;
}

#login-error {
  display: none;
  font-size: .75rem;
  color: var(--red);
  background: var(--red-bg-subtle);
  border: 1px solid var(--red-bg);
  border-radius: 6px;
  padding: 6px 10px;
  margin-top: 8px;
}

/* ── OTP inline row (shown below the login button when MFA is needed) ── */
#otp-section {
  display: none;
  margin-top: 12px;
}

#otp-hint-text {
  font-size: .72rem;
  color: var(--dim);
  margin-bottom: 7px;
  line-height: 1.4;
}

#otp-row {
  display: flex;
  gap: 7px;
  align-items: center;
}

#otp-input {
  flex: 1 1;
  padding: 8px 10px;
  font-size: .95rem;
  font-family: inherit;
  letter-spacing: .15em;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  outline: none;
  -webkit-appearance: none;
}

#otp-input:focus {
  border-color: var(--accent);
}

#otp-submit {
  padding: 8px 14px;
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
  flex-shrink: 0;
}

#otp-submit:hover {
  background: var(--accent-hover);
}

#otp-submit:disabled {
  background: var(--border);
  color: var(--dim);
  cursor: not-allowed;
}

#otp-error {
  display: none;
  font-size: .72rem;
  color: var(--red);
  margin-top: 5px;
}

/* ── Sainsbury's logo button (starts the login flow) ── */
.sainsburys-logo-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 22px 24px;
  margin-top: 18px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s, box-shadow .15s, transform .12s;
}

.sainsburys-logo-btn:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.sainsburys-logo-btn:active {
  transform: scale(.98);
}

.sainsburys-logo-btn img {
  height: 40px;
  width: auto;
  display: block;
}

.sainsburys-logo-spinner {
  font-size: 1.7rem;
  line-height: 40px;
  color: var(--dim);
}

.sainsburys-logo-btn:disabled {
  cursor: not-allowed;
  opacity: .8;
}

.connecting-cycle {
  transition: opacity .35s ease;
}

/* ── Sainsbury's inline credentials form ── */
.sainsburys-login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.login-privacy-note {
  font-size: .7rem;
  color: var(--dim);
  margin-top: 8px;
  line-height: 1.4;
  font-style: italic;
}

/* ── Screens ── */
.screen {
  display: none;
  padding: 8px 0 20px;
  animation: fadeIn .18s ease;
}

.screen.active {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Idle / input ── */
.welcome {
  text-align: left;
  padding: 0 0 14px;
}

.welcome h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.welcome p {
  font-size: .82rem;
  color: var(--dim);
  line-height: 1.5;
}

/* ── Previous Purchases ───────────────────────────────────────────────────── */
.prev-purchases {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 14px;
}

.prev-purchases__label {
  font-size: .72rem;
  font-weight: 400;
  color: var(--dim);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.prev-purchases__scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
  padding-top: 8px;
  margin-top: -8px;
}

.prev-purchases__scroll::-webkit-scrollbar {
  display: none;
}

.prev-purchase-btn {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--dim);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.prev-purchase-btn:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.prev-purchase-btn--active {
  border-color: var(--green-bg);
  background: var(--green-bg-subtle);
  color: var(--green);
}

.prev-purchase-btn--draft {
  border-color: #b8860b;
  background: rgba(255, 200, 0, 0.08);
  color: #c9a200;
}

.prev-purchase-btn--draft:hover {
  border-color: #c9a200;
  background: rgba(255, 200, 0, 0.14);
  color: #e6b800;
}

.prev-purchase-date {
  font-size: .7rem;
  font-weight: 400;
  white-space: nowrap;
}

.prev-purchase-total {
  font-size: .78rem;
  font-weight: 600;
  white-space: nowrap;
}

.input-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.image-preview-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.image-preview-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.image-preview-label {
  font-size: .8rem;
  color: var(--dim);
}

#grocery-input {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text);
  padding: 14px 16px;
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  min-height: 130px;
  resize: none;
  -webkit-appearance: none;
  caret-color: var(--accent);
}

#grocery-input:focus {
  outline: none;
}

#grocery-input::placeholder {
  color: var(--dim);
}

.example-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 12px 4px;
}

.example-chip {
  background: #E8EDF6;
  border: 1px solid #C4CBD8;
  color: #4F5A6E;
  font-size: .72rem;
  font-family: inherit;
  border-radius: 20px;
  padding: 3px 10px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.example-chip:hover {
  background: #D9E0F0;
  border-color: #A0ABBE;
  color: #2E3648;
}

.example-chip svg {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  stroke: #7B87A0;
  transition: stroke .15s;
}

.example-chip:hover svg {
  stroke: #4F5A6E;
}

.input-divider {
  border: none;
  border-top: 1px solid var(--border);
}

.input-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
}

.input-tool-btn {
  height: 34px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--dim);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  cursor: pointer;
  flex-shrink: 0;
  font-size: .72rem;
  font-family: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, color .15s;
}

.input-tool-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.input-tool-btn:active {
  background: var(--border);
}

.input-tool-btn svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-spacer {
  flex: 1 1;
}

#parse-btn {
  height: 34px;
  padding: 0 14px 0 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  font-weight: 600;
  font-family: inherit;
  flex-shrink: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s, box-shadow .18s, transform .12s;
  box-shadow: 0 1px 4px rgba(46, 125, 91, .18);
  letter-spacing: .01em;
}

#parse-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(46, 125, 91, .28);
}

#parse-btn:active {
  background: var(--accent-mid);
  transform: scale(.97);
  box-shadow: none;
}

#parse-btn:disabled {
  background: var(--border);
  color: var(--dim);
  cursor: not-allowed;
  box-shadow: none;
}

#parse-btn svg {
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
}

#parse-btn:hover svg {
  transform: translateX(3px);
}

/* ── Parsing spinner ── */
.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 80px 0;
  color: var(--dim);
  font-size: .9rem;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pen-write {
  0% {
    transform: rotate(-8deg) translate(0, 0);
  }

  30% {
    transform: rotate(4deg) translate(1px, -1px);
  }

  60% {
    transform: rotate(-6deg) translate(-1px, 0px);
  }

  100% {
    transform: rotate(-8deg) translate(0, 0);
  }
}

#step-1-circle.active {
  border-color: var(--accent) !important;
  background: var(--accent-faint) !important;
  overflow: visible !important;
}

#step-1-circle.active::after {
  content: '';
  display: block;
  width: 10px;
  height: 10px;
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E7D5B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 20h9'/%3E%3Cpath d='M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4 12.5-12.5z'/%3E%3C/svg%3E") center/contain no-repeat;
  animation: pen-write 1.4s ease-in-out infinite;
  transform-origin: center center;
}

.spinner {
  font-size: 2.2rem;
  display: inline-block;
  animation: spin 1s linear infinite;
}

/* ── Item list (confirm + shopping) ── */
.list-header {
  margin-bottom: 2px;
}

.list-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.confirm-prompt {
  font-size: .72rem;
  color: var(--dim-light);
  line-height: 1.45;
  margin-bottom: 4px;
  font-style: italic;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.recipe-source {
  display: none;
  font-size: .72rem;
  color: var(--dim);
  margin-bottom: 10px;
}

.recipe-source a {
  color: var(--accent);
  text-decoration: none;
  font-style: normal;
}

.recipe-source a:hover {
  text-decoration: underline;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font-size: .85rem;
  cursor: pointer;
  padding: 4px 0;
}

.picking-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.picking-cancel-btn {
  background: none;
  border: 1px solid var(--red-bg);
  color: var(--red);
  font-size: .78rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 7px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s;
}

.picking-cancel-btn:hover {
  background: var(--red-bg-subtle);
}

.picking-cancel-btn:active {
  background: var(--red-bg);
}

.item-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.item-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px 8px 5px 12px;
  transition: border-color .2s, background .2s, box-shadow .2s, transform .15s;
}

.item-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
  transform: translateY(-1px);
}

.item-card.active {
  border-color: var(--accent);
  background: #eefaf7;
  transform: none;
}

.item-card.done {
  border-color: var(--green-bg);
  background: var(--green-bg-subtle);
  transform: none;
}

.item-card.error {
  border-color: var(--red-bg);
  background: var(--red-bg-subtle);
  transform: none;
}

.item-icon {
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  color: var(--border);
  line-height: 1;
}

.item-card.active .item-icon {
  color: var(--accent);
  display: inline-block;
  animation: spin 1s linear infinite;
}

.item-card.done .item-icon {
  color: var(--green);
  animation: none;
}

.item-card.error .item-icon {
  color: var(--red);
  animation: none;
}

.item-body {
  flex: 1 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.item-name {
  display: block;
  font-size: .92rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Trolley item names (Shopping complete screen) wrap instead of truncating —
   the item name is the whole point of the row, so it shouldn't get cut off
   on narrow screens just to keep the price/remove button on one line. */
.item-name--wrap {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
  line-height: 1.3;
}

.item-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  flex-shrink: 0;
}

.item-edit-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--dim-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.item-edit-btn:hover {
  background: var(--bg);
  color: var(--text);
}

.item-edit-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.item-trash-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--dim-light);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.item-trash-btn:hover {
  background: #fde8e8;
  color: #c0392b;
}

.item-trash-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.item-card--removed {
  opacity: 0.55;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 10px;
}

.item-name--removed {
  flex: 1 1;
  font-size: .92rem;
  color: var(--dim);
  text-decoration: line-through;
}

.item-undo-btn {
  flex-shrink: 0;
  font-size: .78rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  transition: background .15s, color .15s;
}

.item-undo-btn:hover {
  background: var(--accent);
  color: #fff;
}

.item-edit-input {
  flex: 1 1;
  min-width: 80px;
  font-size: .92rem;
  font-family: inherit;
  color: var(--text);
  border: none;
  border-bottom: 1.5px solid var(--accent);
  background: transparent;
  outline: none;
  padding: 0 2px;
}

.item-product {
  display: flex;
  align-items: baseline;
  min-width: 0;
  font-size: .76rem;
  color: var(--dim);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-product-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.item-price {
  flex-shrink: 0;
}

.item-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: .72rem;
  color: var(--dim);
  vertical-align: middle;
  white-space: nowrap;
}

.item-card.done .item-product {
  color: var(--green);
}

.item-card.error .item-product {
  color: var(--red);
}

.cycling-status {
  flex-shrink: 0;
  font-size: .72rem;
  color: var(--green);
  white-space: nowrap;
  padding: 0 4px;
  transition: opacity 0.35s ease;
  font-style: italic;
}

.item-product-link {
  color: inherit;
  text-decoration: none;
}

.item-product-link:hover {
  color: var(--accent);
  text-decoration: underline;
}

.item-price {
  color: inherit;
}

.item-card.working {
  border-color: var(--orange);
  background: var(--panel);
  transform: none;
}

.item-card.working .item-icon {
  color: var(--orange);
  display: inline-block;
  animation: spin 1s linear infinite;
}

.item-remove-btn {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: none;
  background: var(--red-bg-subtle);
  color: var(--red);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.item-card.done .item-remove-btn {
  display: flex;
}

.item-remove-btn:hover {
  background: var(--red-bg);
  color: var(--red);
}

.item-remove-btn svg {
  width: 14px;
  height: 14px;
}

.item-card.removed {
  border-color: var(--border);
  background: var(--panel);
  opacity: .7;
  transform: none;
}

.item-card.removed .item-icon {
  color: var(--dim);
  animation: none;
}

.item-card.removed .item-product {
  color: var(--dim);
}

.item-undo-btn {
  flex-shrink: 0;
  height: 26px;
  padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: .75rem;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.item-undo-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ── CTA button ── */
@keyframes cta-sweep {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

@keyframes grain {

  0%,
  100% {
    transform: translate(0, 0);
  }

  10% {
    transform: translate(-2px, 1px);
  }

  20% {
    transform: translate(2px, -2px);
  }

  30% {
    transform: translate(-1px, -2px);
  }

  40% {
    transform: translate(3px, 1px);
  }

  50% {
    transform: translate(-2px, 3px);
  }

  60% {
    transform: translate(2px, 0px);
  }

  70% {
    transform: translate(0px, -2px);
  }

  80% {
    transform: translate(-3px, 2px);
  }

  90% {
    transform: translate(2px, 2px);
  }
}

@keyframes sparkle-pop {

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

  30% {
    transform: scale(1.5) rotate(-20deg);
  }

  60% {
    transform: scale(.85) rotate(14deg);
  }
}

@keyframes cta-breathe {

  0%,
  100% {
    box-shadow: 0 2px 8px rgba(46, 125, 91, .18);
  }

  50% {
    box-shadow: 0 3px 14px rgba(46, 125, 91, .28);
  }
}

.cta-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  padding: 13px 18px;
  margin-top: 18px;
  background: linear-gradient(135deg,
      #4E6B58 0%,
      #617A6A 30%,
      #7A9284 55%,
      #637265 78%,
      #4E6B58 100%);
  background-size: 200% 200%;
  color: #f0f6ef;
  border: none;
  border-radius: 11px;
  font-size: .9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s;
  animation: cta-sweep 9s ease-in-out infinite, cta-breathe 5s ease-in-out infinite;
  letter-spacing: .02em;
}

.cta-btn::before {
  content: '';
  pointer-events: none;
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.68' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  opacity: .07;
  mix-blend-mode: soft-light;
  animation: grain 3s steps(1) infinite;
}

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

.cta-btn:hover .cta-arrow {
  transform: translateX(4px);
}

.cta-btn:hover .cta-sparkle {
  animation: sparkle-pop .55s ease forwards;
}

.cta-btn:active {
  transform: scale(.98);
}

.cta-arrow {
  transition: transform .2s cubic-bezier(.34, 1.56, .64, 1);
  display: inline-block;
  position: relative;
  z-index: 1;
}

.cta-sparkle {
  display: inline-block;
  font-style: normal;
  position: relative;
  z-index: 1;
}

.cta-btn> :not(.cta-sparkle):not(.cta-arrow) {
  position: relative;
  z-index: 1;
}

.cta-btn.secondary {
  background: transparent;
  color: var(--dim);
  border: 1px solid var(--border);
  box-shadow: none;
  margin-top: 10px;
  font-weight: 400;
  font-size: .88rem;
  animation: none;
}

.cta-btn.secondary:hover {
  background: var(--bg-subtle);
  box-shadow: none;
  transform: none;
}

.cta-btn.secondary:active {
  background: var(--border);
  transform: none;
}

/* ── Progress bar ── */
.progress-header {
  margin-bottom: 16px;
}

#progress-label {
  font-size: .82rem;
  color: var(--dim);
  margin-bottom: 8px;
}

#progress-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .4s ease;
  width: 0%;
}

/* ── Debug console ── */
#console-wrap {
  margin-top: 22px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

#console-wrap>summary {
  padding: 9px 14px;
  background: var(--panel);
  font-size: .76rem;
  color: var(--dim);
  cursor: pointer;
  list-style: none;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#console-wrap>summary::-webkit-details-marker {
  display: none;
}

#console-wrap>summary::before {
  content: '▶  ';
  font-size: .65rem;
}

#console-wrap[open]>summary::before {
  content: '▼  ';
}

#console-log {
  max-height: 220px;
  overflow-y: auto;
  padding: 8px 12px;
  font-family: 'Menlo', 'Consolas', monospace;
  font-size: .7rem;
  color: var(--dim);
  background: var(--bg-subtle);
  line-height: 1.65;
}

/* ── Done screen ── */
.done-header {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--green);
  text-align: center;
  padding: 4px 0 18px;
}

/* ── Delivery screen ── */
.delivery-loading {
  display: flex;
  align-items: center;
  padding: 14px 0;
}

/* Standard / Saver toggle */
.slot-toggle-row {
  display: flex;
  gap: 0;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px;
  width: -moz-fit-content;
  width: fit-content;
  margin-bottom: 8px;
}

.slot-toggle-btn {
  padding: 5px 14px;
  border-radius: 16px;
  border: none;
  background: transparent;
  color: var(--dim);
  font-size: .78rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
  white-space: nowrap;
}

.slot-toggle-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 1px 4px rgba(46, 125, 91, .25);
}

/* Week navigation */
.slot-week-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.slot-week-btn {
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  color: var(--dim);
  font-size: .75rem;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s;
  white-space: nowrap;
}

.slot-week-btn:hover:not(:disabled) {
  background: var(--bg-subtle);
  color: var(--text);
}

.slot-week-btn:disabled {
  opacity: .35;
  cursor: not-allowed;
}

/* Slot grid */
.slot-grid-wrap {
  overflow-x: auto;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 4px;
  /* allow horizontal scroll without affecting vertical page scroll */
  -webkit-overflow-scrolling: touch;
}

.slot-grid {
  border-collapse: collapse;
  font-size: .78rem;
  white-space: nowrap;
}

/* Day header */
.slot-th-time {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--bg-subtle);
  min-width: 90px;
  width: 90px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.slot-th-day {
  text-align: center;
  padding: 7px 8px;
  font-weight: 600;
  color: var(--dim);
  font-size: .72rem;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  min-width: 90px;
}

.slot-th-day:last-child {
  border-right: none;
}

/* Section header row (Morning / Afternoon / Evening) */
.slot-section-hdr td {
  padding: 6px 10px;
  font-weight: 700;
  font-size: .8rem;
  color: var(--text);
  background: var(--bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Time column */
.slot-td-time {
  position: -webkit-sticky;
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--panel);
  padding: 7px 10px;
  color: var(--dim);
  font-size: .72rem;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-width: 90px;
  width: 90px;
}

.slot-row:last-child .slot-td-time,
.slot-row:last-child .slot-cell {
  border-bottom: none;
}

/* Slot cells */
.slot-cell {
  text-align: center;
  padding: 7px 8px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  min-width: 90px;
  vertical-align: middle;
}

.slot-cell:last-child {
  border-right: none;
}

.slot-booked {
  color: var(--dim);
  font-size: .72rem;
}

.slot-na {
  color: var(--border);
}

.slot-cell--avail {
  display: table-cell;
  /* keep as td */
  cursor: pointer;
  transition: background .12s;
}

.slot-cell--avail:hover {
  background: var(--green-bg-subtle);
}

.slot-cell--avail .slot-price {
  font-weight: 500;
  color: var(--text);
}

.slot-eco {
  width: 13px;
  height: 13px;
  vertical-align: middle;
  margin-right: 3px;
  color: var(--green);
  display: inline-block;
  stroke: var(--green);
}

.cta-btn[target] {
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Flow timeline ── */
#flow {
  flex: 1 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px 40px;
  background: transparent;
}

.flow-step+.flow-step {
  margin-top: 16px;
}

.flow-step-header {
  display: flex;
  align-items: center;
  gap: 9px;
}

.flow-step {
  position: relative;
}

.flow-step-body {
  position: relative;
  margin-left: 28px;
  margin-top: 6px;
  padding: 10px 12px;
  background: var(--panel);
  border-radius: 8px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, .07), 0 0 0 0.5px rgba(0, 0, 0, .05);
}

.flow-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 7px;
  top: 16px;
  bottom: -16px;
  width: 1px;
  background: var(--border);
  transition: background .4s;
}

.flow-step:not(:last-child):has(.step-circle.done)::after {
  background: var(--green);
}

.step-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .6rem;
  font-weight: 600;
  transition: background .3s, border-color .3s;
}

.step-circle.waiting {
  border: 1.5px solid var(--border);
  background: var(--bg);
}

.step-circle.active {
  border: 2px solid transparent;
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  background: var(--bg);
  animation: spin .8s linear infinite;
}

.step-circle.processing {
  border: 1.5px solid var(--accent);
  background: var(--accent-faint);
  animation: none;
  overflow: visible;
}

.step-circle.processing::after {
  content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232E7D5B' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
  display: block;
  width: 10px;
  height: 10px;
  line-height: 1;
}

.step-circle.done {
  border: 1.5px solid var(--green);
  background: var(--green);
  color: #fff;
}

#step-1-circle.active {
  border: 1.5px solid var(--accent) !important;
  animation: none !important;
}

.step-label {
  font-size: .72rem;
  color: var(--dim);
  line-height: 1.3;
  white-space: nowrap;
  transition: color .3s;
}

.step-label.active {
  color: var(--text);
  font-weight: 500;
}

.step-label.done {
  color: var(--green);
}

.step-label.done.clickable {
  cursor: pointer;
}

/* ── Step reveal / close ── */
.flow-step-body.body-hidden {
  display: none;
}

@keyframes stepReveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes stepClose {
  from {
    opacity: 1;
    transform: none;
  }

  to {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.flow-step-body.body-reveal {
  animation: stepReveal .22s ease forwards;
}

.flow-step-body.body-closing {
  animation: stepClose .18s ease forwards;
  overflow: hidden;
}

/* ── Auth: checking state ── */
.auth-checking {
  position: fixed;
  inset: 0;
  background: var(--bg);
}

/* ── Auth: login screen ── */
.auth-screen {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  padding-top: max(40px, calc(env(safe-area-inset-top, 0px) + 24px));
  background: var(--bg);
  z-index: 1000;
  overflow-y: auto;
  animation: authScreenIn .3s ease;
}

.auth-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.auth-screen.auth-screen--out {
  animation: authScreenOut .32s ease forwards;
  pointer-events: none;
}

@keyframes authScreenIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes authScreenOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(1.02); }
}

.auth-card {
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 6px;
}

.auth-brand-logo {
  height: 44px;
  width: auto;
  display: block;
  flex-shrink: 0;
}

.auth-brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -.3px;
}

.auth-tagline {
  text-align: center;
  font-size: .84rem;
  font-weight: 500;
  color: var(--text-mid);
  margin-bottom: 6px;
}

.auth-version-badge {
  text-align: center;
  font-family: 'Courier New', ui-monospace, monospace;
  font-size: .66rem;
  font-weight: 500;
  color: var(--dim);
  margin-bottom: 14px;
}

.auth-subtitle {
  text-align: center;
  font-size: .8rem;
  color: var(--dim);
  margin-bottom: 20px;
}

.auth-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--panel);
  color: var(--text-mid);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, box-shadow .15s;
}

.auth-google-btn:hover {
  background: var(--panel-tinted);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.auth-google-btn:active {
  background: var(--bg-subtle);
}

.auth-google-btn:disabled {
  cursor: not-allowed;
  opacity: .6;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  font-size: .7rem;
  color: var(--dim-light);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1 1;
  height: 1px;
  background: var(--border);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.auth-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--panel-tinted);
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: .85rem;
  font-family: inherit;
  color: var(--text);
  transition: border-color .15s, background .15s;
}

.auth-input::placeholder {
  color: var(--dim-light);
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--panel);
}

.auth-input:disabled {
  opacity: .6;
}

.auth-error {
  font-size: .74rem;
  color: var(--red);
  background: var(--red-bg-subtle);
  border-radius: 7px;
  padding: 7px 10px;
  line-height: 1.4;
}

.auth-submit-btn {
  width: 100%;
  padding: 10px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 9px;
  font-size: .84rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s, box-shadow .18s, transform .12s;
  box-shadow: 0 1px 4px rgba(46, 125, 91, .18);
  margin-top: 4px;
}

.auth-submit-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(46, 125, 91, .28);
}

.auth-submit-btn:active:not(:disabled) {
  background: var(--accent-mid);
  transform: scale(.98);
  box-shadow: none;
}

.auth-submit-btn:disabled {
  background: var(--border);
  color: var(--dim);
  cursor: not-allowed;
  box-shadow: none;
}

.auth-enter-btn {
  width: 100%;
  padding: 13px 14px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .92rem;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: -.1px;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s, box-shadow .18s, transform .12s;
  box-shadow: 0 2px 8px rgba(46, 125, 91, .22);
}

.auth-enter-btn:hover {
  background: var(--accent-hover);
  box-shadow: 0 3px 12px rgba(46, 125, 91, .32);
}

.auth-enter-btn:active {
  background: var(--accent-mid);
  transform: scale(.98);
  box-shadow: none;
}

.auth-login-reveal {
  animation: authLoginReveal .4s ease;
}

@keyframes authLoginReveal {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-toggle-text {
  text-align: center;
  margin-top: 16px;
  font-size: .76rem;
  color: var(--dim);
}

.auth-toggle-link {
  background: none;
  border: none;
  padding: 0;
  font-size: .76rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.auth-toggle-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* ── Auth: how it works ── */
.auth-how {
  width: 100%;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--panel-tinted);
  border: 1px solid var(--border);
  border-radius: 14px;
}

.auth-how-title {
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-mid);
  margin-bottom: 10px;
}

.auth-how-list {
  list-style: none;
  counter-reset: auth-how;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.auth-how-list li {
  counter-increment: auth-how;
  position: relative;
  padding-left: 20px;
  font-size: .76rem;
  color: var(--dim);
  line-height: 1.4;
}

.auth-how-list li::before {
  content: counter(auth-how) '.';
  position: absolute;
  left: 0;
  top: 0;
  font-weight: 700;
  color: var(--accent);
}

.auth-how-text {
  font-size: .76rem;
  color: var(--dim);
  line-height: 1.4;
}

.auth-info {
  position: relative;
  display: inline-flex;
  margin-left: 4px;
  vertical-align: middle;
}

.auth-info-icon {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid var(--dim-light);
  color: var(--dim);
  font-size: .62rem;
  font-weight: 700;
  line-height: 12px;
  text-align: center;
  cursor: help;
  -webkit-user-select: none;
     -moz-user-select: none;
          user-select: none;
}

.auth-info-tooltip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  width: 200px;
  padding: 8px 10px;
  background: var(--text);
  color: #fff;
  font-size: .68rem;
  font-weight: 400;
  line-height: 1.4;
  border-radius: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s, transform .15s;
  z-index: 20;
}

.auth-info-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--text);
}

.auth-info:hover .auth-info-tooltip,
.auth-info:focus-within .auth-info-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* ── Auth: app reveal ── */
.auth-app-in {
  display: flex;
  flex-direction: column;
  flex: 1 1;
  min-height: 0;
  animation: authAppIn .4s ease;
}

@keyframes authAppIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── App footer ── */
.app-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding: 12px 4px 4px;
  border-top: 1px solid var(--border);
  font-size: .72rem;
  color: var(--dim-light);
}

.app-footer a {
  color: var(--dim);
  text-decoration: none;
}

.app-footer a:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* ── Legal pages (Terms / Privacy) ── */
.legal-page {
  flex: 1 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 20px 48px;
}

.legal-page h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 4px;
  letter-spacing: -.3px;
}

.legal-page h2 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--text);
  margin: 22px 0 6px;
}

.legal-page p {
  font-size: .84rem;
  color: var(--text-mid);
  line-height: 1.6;
  margin-bottom: 6px;
}

.legal-page a {
  color: var(--accent);
}

.legal-updated {
  font-size: .74rem !important;
  color: var(--dim) !important;
  margin-bottom: 18px !important;
}
