:root {
  --bg: #f3efe7;
  --ink: #101715;
  --muted: #66716c;
  --surface: #fcfbf8;
  --surface-2: #f6f1e7;
  --line: rgba(16, 23, 21, 0.08);
  --green: #1c6b43;
  --green-deep: #12462c;
  --green-soft: rgba(28, 107, 67, 0.12);
  --shadow: 0 22px 60px rgba(27, 37, 33, 0.12);
  --radius-xl: 32px;
  --radius-lg: 26px;
  --radius-md: 22px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, 0.95), transparent 25%),
    radial-gradient(circle at 90% 85%, rgba(161, 198, 174, 0.45), transparent 18%),
    linear-gradient(180deg, #f6f2ea 0%, #e2eadf 100%);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(100%, 430px);
  margin: 0 auto;
  padding: 18px 16px 34px;
}

.hero-card,
.payment-card,
.summary-card,
.status-card {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
}

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 22px 22px 24px;
  margin-bottom: 16px;
  color: #f7faf7;
  background:
    radial-gradient(circle at top right, rgba(101, 180, 135, 0.32), transparent 30%),
    linear-gradient(145deg, #13221c 0%, #183428 55%, #1d6b43 120%);
}

.hero-card::after {
  content: "";
  position: absolute;
  right: -24px;
  bottom: -34px;
  width: 128px;
  height: 128px;
  border-radius: 32px;
  transform: rotate(18deg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.02));
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.eyebrow,
.step,
.summary-label,
.status-tag,
.amount-label {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  color: rgba(247, 250, 247, 0.76);
}

.signal-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #77d89d;
  box-shadow: 0 0 0 8px rgba(119, 216, 157, 0.14);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  margin-top: 20px;
  font-size: clamp(2rem, 8vw, 2.8rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.lead {
  margin-top: 12px;
  max-width: 20ch;
  color: rgba(247, 250, 247, 0.78);
  font-size: 0.98rem;
  line-height: 1.45;
}

.payment-card,
.status-card {
  padding: 22px;
  border: 1px solid var(--line);
  background: rgba(252, 251, 248, 0.82);
  backdrop-filter: blur(14px);
}

.payment-card {
  margin-bottom: 16px;
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 18px;
}

.step,
.summary-label,
.status-tag,
.amount-label {
  color: var(--muted);
}

.section-head h2 {
  font-size: 1.35rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.amount-panel {
  display: block;
}

.amount-input-frame {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  margin-top: 10px;
  padding: 0 18px;
  border: 1px solid rgba(16, 23, 21, 0.08);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(245, 240, 232, 0.88));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.currency-prefix,
.currency-suffix {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.amount-input-frame input {
  width: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.08em;
}

.helper-text {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.summary-card {
  position: sticky;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(16, 23, 21, 0.08);
  background: rgba(252, 251, 248, 0.92);
  backdrop-filter: blur(18px);
}

.summary-copy {
  min-width: 0;
}

.summary-amount {
  margin-top: 4px;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.06em;
}

.primary-action {
  min-height: 58px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #238050 0%, var(--green) 100%);
  color: #f7faf7;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 14px 28px rgba(28, 107, 67, 0.24);
}

.primary-action:hover {
  background: linear-gradient(180deg, #248754 0%, #1a603c 100%);
}

.primary-action:disabled {
  opacity: 0.62;
  cursor: wait;
}

.status-card {
  margin-top: 16px;
}

.status-card h2 {
  margin-top: 8px;
  font-size: 1.25rem;
  letter-spacing: -0.03em;
}

.status-card p:last-child {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.hidden {
  display: none;
}

/* SnaxSpot payment layout */
.snaxspot-layout {
  min-height: 100svh;
  padding-top: 28px;
}

.snaxspot-hero {
  height: 76px;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 22px;
}

.header-logo {
  position: absolute;
  z-index: 1;
  top: 12px;
  left: 12px;
  width: min(68vw, 270px);
  height: 52px;
  object-fit: contain;
  object-position: left center;
}

.language-switcher {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 12px;
  display: flex;
  gap: 4px;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

.language-option { padding: 0; border: 0; background: transparent; color: #fff; font: inherit; font-size: inherit; font-weight: inherit; cursor: pointer; }
.muted-language { color: rgba(255, 255, 255, 0.55); }

.step-card {
  position: static;
  display: grid;
  min-height: clamp(270px, 44svh, 360px);
  margin: 0 0 12px;
  padding: 28px 24px;
  border: 2px solid #a7afaa;
  background: radial-gradient(circle at 50% -10%, rgba(119, 216, 157, 0.28), transparent 48%), linear-gradient(180deg, #fdfcf9, #edf5ec);
  text-align: center;
}

.step-card h1 { margin: 0; font-size: clamp(1.7rem, 7vw, 2.2rem); }
.step-card > p:not(.summary-label) { color: var(--muted); line-height: 1.45; }
.step-card .primary-action { width: min(100%, 310px); min-height: 76px; margin: 0 auto; border: 2px solid #8f9993; font-size: 1.15rem; }
.step-card .summary-label, .purchase-card .step { justify-self: center; display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1.5px solid #8f9993; border-radius: 999px; background: var(--green-soft); color: var(--ink); }

.suggestion-card {
  margin-bottom: 12px;
  padding: 16px;
  border: 1.5px solid #a7afaa;
  border-radius: 22px;
  background: rgba(252, 251, 248, 0.9);
  box-shadow: 3px 4px 0 rgba(16, 23, 21, 0.08);
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.suggestion-card strong { color: var(--ink); }
.suggestion-card a { color: var(--green-deep); font-weight: 800; }

.purchase-card { min-height: min(520px, 66svh); margin: 0 0 12px; }
.purchase-card .step { justify-self: start; margin-bottom: 10px; }
.purchase-card h2 { font-size: clamp(1.35rem, 6vw, 1.7rem); }
.purchase-card .amount-label { margin-top: 16px; }

.vending-preview {
  position: relative;
  display: grid;
  flex: 1;
  min-height: 280px;
  margin-top: 10px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(16, 23, 21, 0.08);
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 35%, rgba(119, 216, 157, 0.13), transparent 52%), #f4f7f2;
}

.machine-gif-frame { height: 95%; max-width: 80%; overflow: hidden; border: 1.5px solid #9aa39d; border-radius: 22px; }
.machine-gif-frame img { display: block; width: 100%; height: 100%; object-fit: cover; }
.product-loading, .product-result { display: grid; justify-items: center; gap: 16px; width: 100%; height: 100%; align-content: center; }
.product-result { padding: 18px; background: linear-gradient(180deg, #ffffff, #fffdf9); }
.product-result img { max-width: 78%; height: min(230px, 35svh); object-fit: contain; }
.product-result p { font-size: 1.65rem; font-weight: 800; }

.product-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.product-pay, .product-cancel { min-width: 170px; min-height: 58px; padding: 0 22px; border-radius: 999px; font: inherit; font-weight: 800; }
.product-pay { border: 2px solid #8f9993; background: linear-gradient(180deg, #26935b, var(--green)); color: #fff; box-shadow: 4px 5px 0 rgba(16, 23, 21, 0.16); }
.product-cancel { border: 1.5px solid #b8aaa0; background: #fff7f1; color: #7a3426; }
.product-pay:disabled, .product-cancel:disabled { opacity: 0.6; cursor: wait; }

.panel-loading { display: grid; justify-items: center; gap: 16px; }
.loading-spinner { width: 54px; height: 54px; border: 6px solid rgba(28, 107, 67, 0.16); border-top-color: var(--green); border-radius: 50%; animation: loading-spin 850ms linear infinite; }
@keyframes loading-spin { to { transform: rotate(360deg); } }

.payment-loading-overlay { position: fixed; z-index: 1000; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: rgba(243, 239, 231, 0.92); backdrop-filter: blur(14px); color: var(--green-deep); font-weight: 800; }
.hidden { display: none !important; }

.snaxspot-layout .payment-methods { margin-top: 0; }

.admin-shell {
  width: min(100%, 760px);
}

.admin-input {
  width: 100%;
  margin-top: 10px;
  padding: 16px;
  border: 1px solid rgba(16, 23, 21, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-weight: 800;
}

.admin-action {
  margin-top: 18px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.admin-actions .admin-action {
  margin-top: 0;
}

.secondary-action {
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid rgba(16, 23, 21, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-weight: 800;
}

.secondary-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.admin-page-link { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 18px; border: 2px solid #0e5a35; border-radius: 999px; background: #0e5a35; color: #fff !important; font-weight: 900; text-decoration: none; box-shadow: 0 5px 14px rgba(14, 90, 53, 0.22); }
.admin-page-link:hover { background: #083d24; border-color: #083d24; color: #fff !important; }
.feedback-button { display: inline-flex; margin-top: 12px; min-height: 44px; align-items: center; justify-content: center; padding: 0 18px; border-radius: 999px; background: var(--green); color: #fff; font-weight: 800; text-decoration: none; }
.feedback-button:hover { background: var(--green-deep); color: #fff; }
.feedback-shell { width: min(100%, 620px); }
.feedback-form { display: grid; gap: 18px; }
.feedback-textarea { min-height: 150px; resize: vertical; font: inherit; font-weight: 500; }
.feedback-back { background: rgba(255, 255, 255, 0.76); border-color: rgba(16, 23, 21, 0.12); color: var(--ink) !important; box-shadow: none; }
.feedback-back:hover { background: #fff; border-color: rgba(16, 23, 21, 0.2); color: var(--ink) !important; }
.statistics-shell { width: min(100%, 980px); }
.statistics-filters { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 18px; }
.statistics-filters label { flex: 1 1 150px; color: var(--muted); font-weight: 800; }
.statistics-filters .admin-input { min-height: 50px; margin-top: 6px; padding: 10px 14px; }

.receipt-actions { margin: 16px 0; }
.receipt-list { display: grid; gap: 10px; }
.receipt-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid rgba(16, 23, 21, 0.1); border-radius: 16px; background: rgba(255, 255, 255, 0.7); }
.receipt-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.9rem; }
.receipt-row-total { display: grid; justify-items: end; gap: 5px; white-space: nowrap; }
.receipt-row a { color: var(--green-deep); font-weight: 800; }
.muted-copy { color: var(--muted); }
.statistics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.statistics-grid-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.statistic-card { display: grid; gap: 6px; padding: 16px; border: 1px solid rgba(16, 23, 21, 0.1); border-radius: 16px; background: rgba(255, 255, 255, 0.7); }
.statistic-card span, .statistic-card small { color: var(--muted); }
.statistic-card strong { font-size: 1.1rem; }
.top-products { margin-top: 18px; }
.top-products h3 { margin: 0 0 10px; font-size: 1rem; }
.top-products ol { display: grid; gap: 8px; margin: 0; padding-left: 22px; }
.top-products li { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); }
.top-products li strong { white-space: nowrap; }
.statistics-table-wrap { overflow-x: auto; }
.statistics-table { width: 100%; border-collapse: collapse; text-align: left; }
.statistics-table th, .statistics-table td { padding: 12px 10px; border-bottom: 1px solid rgba(16, 23, 21, 0.1); }
.statistics-table th { color: var(--muted); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; }
.statistics-table td:not(:first-child), .statistics-table th:not(:first-child) { text-align: right; white-space: nowrap; }
.table-empty { color: var(--muted); text-align: center !important; }
.bar-chart { height: 210px; display: flex; align-items: end; gap: 3px; padding-top: 16px; overflow-x: auto; }
.bar-chart-item { flex: 1 0 18px; min-width: 18px; height: 100%; display: grid; grid-template-rows: 1fr 20px; align-items: end; gap: 6px; }
.bar-chart-bar { display: block; min-height: 1px; border-radius: 6px 6px 2px 2px; background: var(--green); }
.bar-chart-item small { overflow: hidden; color: var(--muted); font-size: 0.65rem; text-align: center; white-space: nowrap; }
.hour-chart .bar-chart-item { flex-basis: 24px; }
@media (max-width: 760px) { .statistics-grid-wide { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .statistics-grid, .statistics-grid-wide { grid-template-columns: 1fr; } .top-products li { align-items: flex-start; flex-direction: column; gap: 2px; } }

.shelf-tabs {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.shelf-tabs button {
  min-height: 46px;
  border: 1px solid rgba(16, 23, 21, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  font-weight: 800;
}

.shelf-tabs button.active {
  background: var(--green);
  color: #f7faf7;
}

.shelf-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
}

.shelf-slot {
  display: grid;
  gap: 5px;
  min-height: 170px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(16, 23, 21, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-align: left;
}

.shelf-slot strong {
  font-size: 0.85rem;
  color: var(--muted);
}

.shelf-slot span {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0;
}

.shelf-slot img,
.slot-image-empty {
  width: 100%;
  height: 76px;
  border: 1px solid rgba(16, 23, 21, 0.08);
  border-radius: 8px;
  background: rgba(16, 23, 21, 0.04);
  object-fit: cover;
}

.shelf-slot small {
  min-height: 1em;
  color: var(--muted);
  overflow-wrap: anywhere;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.payment-methods {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 16px 4px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.card-logos {
  display: flex;
  align-items: center;
  gap: 8px;
}

.visa-logo,
.mastercard-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(16, 23, 21, 0.16);
}

.visa-logo {
  min-width: 48px;
  padding: 0 6px;
  color: #1434cb;
  font-size: 0.84rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.08em;
}

.mastercard-logo {
  position: relative;
  min-width: 70px;
  padding: 0 5px;
  overflow: hidden;
}

.mastercard-logo i,
.mastercard-logo b {
  position: absolute;
  top: 7px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
}

.mastercard-logo i { left: 9px; background: #eb001b; }
.mastercard-logo b { left: 19px; background: #f79e1b; mix-blend-mode: multiply; }
.mastercard-logo em { margin-left: 25px; color: #252525; font-size: 0.55rem; font-style: normal; font-weight: 800; letter-spacing: -0.06em; }

.site-footer {
  margin-top: 22px;
  padding: 18px 8px 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-top: 12px; }
.site-footer a, .legal-page a { color: var(--green-deep); font-weight: 800; }
.site-footer strong { color: var(--ink); }

.legal-page {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 24px 18px 42px;
}

.legal-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(252, 251, 248, 0.9);
  box-shadow: var(--shadow);
}

.legal-card h1 { margin-top: 0; font-size: clamp(2rem, 8vw, 2.7rem); color: var(--ink); }
.legal-card h2 { margin-top: 28px; font-size: 1.1rem; scroll-margin-top: 18px; }
.legal-card p { margin-top: 10px; color: var(--muted); line-height: 1.6; }

.shelf-slot.selected {
  outline: 3px solid rgba(28, 107, 67, 0.28);
}

.shelf-slot.low-stock span {
  color: #c9272e;
}

.overview-grid {
  display: grid;
  gap: 12px;
}

.overview-shelf {
  display: grid;
  gap: 8px;
}

.overview-shelf h3 {
  margin: 0;
  font-size: 0.95rem;
}

.overview-slots {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.overview-slot {
  display: grid;
  gap: 5px;
  min-height: 54px;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(16, 23, 21, 0.08);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  text-align: left;
  cursor: pointer;
}

.overview-slot.selected {
  outline: 3px solid rgba(28, 107, 67, 0.35);
}

.overview-slot strong {
  color: var(--muted);
  font-size: 0.75rem;
}

.overview-slot span {
  color: var(--ink);
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: 0;
}

.overview-slot img,
.overview-slot .slot-image-empty {
  width: 100%;
  height: 56px;
  border: 1px solid rgba(16, 23, 21, 0.08);
  border-radius: 8px;
  background: rgba(16, 23, 21, 0.04);
  object-fit: cover;
}

.overview-slot small {
  min-height: 2.4em;
  overflow: hidden;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.overview-slot.low-stock span {
  color: #c9272e;
}

.inventory-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.inventory-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid rgba(16, 23, 21, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-align: left;
}

.inventory-row small {
  grid-column: 1 / -1;
  color: var(--muted);
}

@media (max-width: 600px) {
  .shelf-tabs {
    grid-template-columns: repeat(3, 1fr);
  }

  .shelf-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .overview-slots {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .summary-card {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-action {
    width: 100%;
  }
}
