:root {
  --bg: #f7f5f0;
  --surface: #fff;
  --ink: #1b2420;
  --muted: #5b6660;
  --line: #e5e0d6;
  --brand: #1f6f5c;
  --brand-soft: #e6f2ee;
  --brand-ink: #fff;
  --danger: #b3261e;
  --warn: #f2b23a;
  --radius: 16px;
  --gap: 1rem;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
#app {
  display: flex;
  flex-direction: column;
  flex: 1;
}
h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
  margin: 0 0 0.35rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
}
h1:focus {
  outline: none;
}
h2 {
  font-size: 1.05rem;
  margin: 0.75rem 0 0.25rem;
}
a {
  color: var(--brand);
}
p {
  margin: 0;
}
.muted {
  color: var(--muted);
  font-size: 0.92rem;
}
.lead {
  color: var(--muted);
  margin: 0 0 1.5rem;
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 10;
  background: var(--surface);
  padding: 0.75rem 1rem;
  border-radius: 8px;
}
.noscript {
  padding: 1rem;
  text-align: center;
}

.pill {
  display: inline-block;
  background: var(--warn);
  color: #3a2800;
  border-radius: 999px;
  padding: 0.05rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  background: var(--ink);
  color: #fff;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
}
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem clamp(1rem, 4vw, 2.5rem);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
}
.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  font-weight: 600;
  text-decoration: none;
  padding: 0 1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink);
}
.badge {
  background: var(--brand);
  color: var(--brand-ink);
  border-radius: 999px;
  min-width: 1.5rem;
  padding: 0 0.45rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
}
.badge[hidden] {
  display: none;
}

main {
  flex: 1;
  width: 100%;
  max-width: 62rem;
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 2.5rem) 3rem;
}
main:focus {
  outline: none;
}
.site-footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 1.5rem 1rem;
}

.how,
.steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 0.5rem;
}
.how {
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  color: var(--muted);
  font-size: 0.92rem;
  counter-reset: how;
}
.how li {
  counter-increment: how;
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 0.25rem 0.8rem;
  color: var(--ink);
}
.how li::before {
  content: counter(how) ". ";
  color: var(--brand);
  font-weight: 700;
}
.steps {
  margin-bottom: 1.25rem;
  align-items: center;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}
.step:not(:last-child)::after {
  content: "";
  flex: 1;
  height: 2px;
  background: var(--line);
  margin-left: 0.25rem;
}
.step.done:not(:last-child)::after {
  background: var(--brand);
}
.dot {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  font-size: 0.8rem;
  flex: none;
}
.step.current {
  color: var(--ink);
}
.step.current .dot {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--brand-ink);
}
.step.done .dot {
  border-color: var(--brand);
  color: var(--brand);
}

.grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.card,
.panel,
.summary,
.lines,
.pay,
.sandbox {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.art {
  --hue: 150;
  height: 7rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 3rem;
  background: hsl(var(--hue) 55% 91%);
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.75rem;
  flex-wrap: wrap;
}
.price {
  font-size: 1.05rem;
}

.btn {
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0 1.2rem;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}
.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--brand-ink);
}
.btn.primary.added {
  background: var(--ink);
  border-color: var(--ink);
}
.btn.small {
  min-width: 2.75rem;
  padding: 0;
  font-size: 1.2rem;
}
.btn.block {
  display: flex;
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn:focus-visible,
.link:focus-visible,
a:focus-visible,
output:focus-visible {
  outline: 3px solid #0b57d0;
  outline-offset: 2px;
}
.link {
  background: none;
  border: 0;
  font: inherit;
  color: var(--muted);
  text-decoration: underline;
  cursor: pointer;
  min-height: 2.75rem;
  padding: 0 0.5rem;
}

.lines {
  list-style: none;
  margin: 0 0 var(--gap);
  padding: 0;
}
.line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.25rem 1rem;
  align-items: center;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--line);
}
.line:last-child {
  border-bottom: 0;
}
.qty {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.qty output {
  min-width: 2rem;
  text-align: center;
  font-weight: 700;
}
.line-total {
  text-align: right;
}
.line .link {
  justify-self: end;
}
.summary {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1.15rem;
  padding-top: 0.5rem;
}
.error {
  color: var(--danger);
  font-weight: 600;
}
.error:empty {
  display: none;
}

.pay-layout {
  display: grid;
  gap: var(--gap);
}
.pay {
  padding: 1.25rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}
.qr {
  width: min(100%, 17rem);
  height: auto;
  image-rendering: pixelated;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.amount {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
progress {
  width: min(100%, 17rem);
  height: 0.5rem;
  appearance: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--line);
  accent-color: var(--brand);
}
progress::-webkit-progress-bar {
  background: var(--line);
}
progress::-webkit-progress-value {
  background: var(--brand);
}
progress::-moz-progress-bar {
  background: var(--brand);
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--brand-soft);
  font-weight: 600;
  font-size: 0.92rem;
}
.live-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--brand);
}
.pay-side {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}
.panel {
  padding: 0.5rem 1.25rem 1.25rem;
}
.panel h2 {
  margin-bottom: 0.5rem;
}
.items {
  list-style: none;
  margin: 0;
  padding: 0;
}
.items li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.95rem;
}
.how-to {
  margin: 0;
  padding-left: 1.25rem;
  display: grid;
  gap: 0.4rem;
}
.how-to li::marker {
  color: var(--brand);
  font-weight: 700;
}

.sandbox {
  margin-top: var(--gap);
  padding: 0.5rem 1.25rem 1.25rem;
  border: 2px dashed var(--warn);
  background: #fffbf0;
}
.sandbox h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.sim {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
.sim li {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.25rem;
}

.result,
.empty {
  max-width: 30rem;
  margin: 1rem auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.result {
  padding: 2rem 1.25rem;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}
.result .btn,
.empty .btn {
  min-width: 12rem;
}
.result-icon,
.empty-icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  border-radius: 50%;
  font-size: 1.75rem;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 800;
}
.result.bad .result-icon {
  background: #fbe9e7;
  color: var(--danger);
}
.facts {
  width: 100%;
  margin: 0.5rem 0;
  display: grid;
  gap: 0.4rem;
}
.facts div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}
.result .items {
  width: 100%;
  text-align: left;
  margin-bottom: 0.5rem;
}
.empty {
  padding: 2.5rem 0;
}

@media (min-width: 40rem) {
  .line {
    grid-template-columns: 1fr auto 8rem auto;
  }
  .sim li {
    flex-direction: row;
    align-items: center;
    gap: 1rem;
  }
  .sim .btn {
    min-width: 14rem;
  }
  .ribbon {
    font-size: 0.9rem;
  }
}
@media (min-width: 52rem) {
  .pay-layout {
    grid-template-columns: 20rem 1fr;
    align-items: start;
  }
  .summary {
    position: sticky;
    top: 1rem;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .card,
  .btn {
    transition:
      box-shadow 0.15s ease,
      transform 0.15s ease,
      background-color 0.15s ease;
  }
  .card:hover {
    box-shadow: 0 6px 18px rgb(0 0 0 / 8%);
  }
  .btn:active {
    transform: scale(0.98);
  }
  .badge.bump {
    animation: bump 0.35s ease;
  }
  .live-dot {
    animation: pulse 1.4s ease-in-out infinite;
  }
  @keyframes bump {
    50% {
      transform: scale(1.35);
    }
  }
  @keyframes pulse {
    50% {
      opacity: 0.3;
    }
  }
}
