:root {
  color-scheme: light;
  --paper: #f4f6f2;
  --ink: #142923;
  --muted: #455d53;
  --accent: #15533e;
  --line: #9aada2;
  --error: #962a27;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }

.checkout {
  width: min(100%, 28rem);
  margin: 0 auto;
  padding: clamp(2.5rem, 12vh, 7rem) 1.375rem 2.125rem;
}

.store {
  border-top: 0.25rem solid var(--accent);
  padding: 1.125rem 0 1.375rem;
}

.store-label, .hint, .footnote, .order-number {
  color: var(--muted);
  font-size: 0.875rem;
}

.store h1 {
  margin: 0.3rem 0 0;
  font-size: 1.95rem;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.collect, .receipt {
  background: #fff;
  border: 1px solid #d5ded7;
  border-radius: 0.875rem;
  padding: 1.3rem;
}

.collect label {
  display: block;
  font-size: 1rem;
  font-weight: 650;
}

.amount-control {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  border-bottom: 1px solid var(--line);
  margin-top: 0.25rem;
  padding: 0.45rem 0;
}

.amount-control:focus-within {
  border-bottom-color: var(--accent);
  box-shadow: 0 1px var(--accent);
}

.amount-control:has([aria-invalid="true"]) { border-bottom-color: var(--error); }
.amount-control span { font-size: 1.7rem; font-weight: 600; }

.amount-control input {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: 600 clamp(1.8rem, 8vw, 2.65rem)/1.3 system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  min-width: 0;
  padding: 0;
  flex: 1;
  outline: none;
}

.amount-control input::placeholder { color: #789084; }
.amount-control input:read-only { color: var(--muted); }
.hint { margin: 0.5rem 0 0; }

.status {
  margin: 0.8rem 0 0;
  font-size: 0.875rem;
  min-height: 1.25rem;
  color: var(--muted);
}

.status[data-error="true"] { color: var(--error); }

button { font: inherit; }

.primary {
  display: block;
  width: 100%;
  color: #fff;
  background: var(--accent);
  border: 1px solid transparent;
  border-radius: 0.625rem;
  font-weight: 650;
  font-size: 1.0625rem;
  min-height: 3.25rem;
  margin-top: 1rem;
  padding: 0.65rem 0.8rem;
  cursor: pointer;
}

.primary:hover:not(:disabled) { background: #103f2e; }

.primary:disabled {
  color: #4b6358;
  background: #e4ece6;
  cursor: default;
}

button:focus-visible, a:focus-visible, .receipt:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.text-button {
  display: block;
  margin: 0.55rem auto 0;
  min-height: 2.75rem;
  border: none;
  background: transparent;
  color: var(--accent);
  padding: 0.4rem 0.8rem;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
  cursor: pointer;
}

.text-button:disabled { color: var(--muted); cursor: wait; }
.footnote { text-align: center; margin: 0.95rem 0 0; }
.receipt h2 { font-size: 1.2rem; color: var(--accent); margin: 0; }
.receipt-amount { font-size: 2.15rem; font-weight: 650; margin: 0.4rem 0; }
.order-number { overflow-wrap: anywhere; }

.print-sheet .collect {
  text-align: center;
}

.print-sheet img {
  display: block;
  inline-size: min(100%, 17rem);
  height: auto;
  margin: 0.6rem auto;
}

@media print {
  :root { background: white; }
  .print-sheet { padding: 0.5cm 0 0; width: 9.5cm; }
  .print-sheet .store { border-color: black; }
  .print-sheet img { inline-size: 6.8cm; }
  .print-sheet button { display: none; }
}
